Questions on the SI language - page 9

 
Кеша Рутов:

Inmine_score*m is a pointer to int, and the comment says that it is an array, i.e. for each row a different number of columns, this is called a "comb array" not a rectangular one.

It simply allocates memory for this array of row lengths, no values

For the matrix M itself.

here is allocated memory for pointers of rows

and here for the columns

Yep, I'll probably have to leave the structure in place so there's no confusion later

I was just going to replace it with a matrix.

 
Maxim Dmitrievsky:

Yeah, we'll probably have to keep the structure so we don't get confused later

I just wanted to replace it with a matrix.

Exactly, not to get confused, there was a time when I also denied enum's, extra structures and so on, everything you can do without, and then you look at this code after a couple of months and it's easier to rewrite from scratch, not to mention other viewers, you can get really embarrassed. Besides, in sys and pluses standard arrays when assigned and passed to a function become references, there's no way to figure out the size and structure in many cases, it's already clear about dynamic ones, it's not even an array but just a piece of memory in the form of a pointer to the first element.

 
 if (param->est == EST_MIC_APPROX)
        ret = OptimizeXAxis(xx, yx, prob->n, Q_map, q, P_map, p, score->m[i]+1,
                            score->M[i]);

That's where I got, when previously declared 2-dimensional array M(double **M; /* the (equi)characteristic matrix */), but this f-i passed only one "comb" string M[i]... and on µl already made through matrices. And now I'm swearing for a long time.

But maybe the problem is farfetched.

 
I like science and technology rap about Chttps://www.youtube.com/watch?v=cdX8r3ZSzN4
 

***

 
Konstantin Nikitin:

bazhenovivansergeevich to Freelance

a little more and he gets banned :-)

if a kind moderator doesn't erase the previous one.

 
Maxim Kuznetsov:

A little more and he gets banned :-)

if a kind moderator doesn't erase the old one.

Well, sometimes a banya can help clear your head.

 

what this construct returns in the end:

typedef struct TF_Status TF_Status;
TF_Status* TF_NewStatus();

I looked at the size ofTF_Status - if compilation is 32-bit, it is 4 bytes, if it is 64-bit, it is 8 bytes.

I cannot figure out whatTF_NewStatus()returns?

 
Igor Makanu:

what this construct returns in the end:

I looked at the size ofTF_Status - if compilation is 32-bit, it is 4 bytes, if it is 64-bit, it is 8 bytes.

I cannot figure out whatTF_NewStatus()returns?

If you write it correctly, it will return the pointer to the structure.