mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 16:44:49 +01:00
R problem for ex16.
memcpy was overwriting the same space if i = row. git-svn-id: svn://136.177.114.72/svn_GW/phreeqc3/trunk@8703 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
c343330920
commit
8b2c1a8d07
43
inverse.cpp
43
inverse.cpp
@ -2790,9 +2790,18 @@ shrink(struct inverse *inv_ptr, LDBLE * array_in, LDBLE * array_out,
|
||||
memcpy(&(array_out[row * max_column_count]), &(array_out[i * max_column_count]),
|
||||
(size_t) max_column_count * sizeof(LDBLE));
|
||||
*/
|
||||
memcpy(&(array_out[row * max_column_count]),
|
||||
&(array_out[i * max_column_count]),
|
||||
(size_t) (*n + 1) * sizeof(LDBLE));
|
||||
if (i > row)
|
||||
{
|
||||
if ((row*max_column_count + (*n + 1)) >= (i * max_column_count))
|
||||
{
|
||||
assert(false);
|
||||
}
|
||||
|
||||
|
||||
memcpy(&(array_out[row * max_column_count]),
|
||||
&(array_out[i * max_column_count]),
|
||||
(size_t) (*n + 1) * sizeof(LDBLE));
|
||||
}
|
||||
row_back_l[row] = i;
|
||||
row++;
|
||||
k1++;
|
||||
@ -2826,9 +2835,17 @@ shrink(struct inverse *inv_ptr, LDBLE * array_in, LDBLE * array_out,
|
||||
memcpy(&(array_out[row * max_column_count]), &(array_out[i * max_column_count]),
|
||||
(size_t) max_column_count * sizeof(LDBLE));
|
||||
*/
|
||||
memcpy(&(array_out[row * max_column_count]),
|
||||
&(array_out[i * max_column_count]),
|
||||
(size_t) (*n + 1) * sizeof(LDBLE));
|
||||
|
||||
if (i > row)
|
||||
{
|
||||
if ((row*max_column_count + (*n + 1)) >= (i * max_column_count))
|
||||
{
|
||||
assert(false);
|
||||
}
|
||||
memcpy(&(array_out[row * max_column_count]),
|
||||
&(array_out[i * max_column_count]),
|
||||
(size_t) (*n + 1) * sizeof(LDBLE));
|
||||
}
|
||||
row_back_l[row] = i;
|
||||
row++;
|
||||
l1++;
|
||||
@ -2861,9 +2878,17 @@ shrink(struct inverse *inv_ptr, LDBLE * array_in, LDBLE * array_out,
|
||||
memcpy(&(array_out[row * max_column_count]), &(array_out[i * max_column_count]),
|
||||
(size_t) max_column_count * sizeof(LDBLE));
|
||||
*/
|
||||
memcpy(&(array_out[row * max_column_count]),
|
||||
&(array_out[i * max_column_count]),
|
||||
(size_t) (*n + 1) * sizeof(LDBLE));
|
||||
|
||||
if (i > row)
|
||||
{
|
||||
if ((row*max_column_count + (*n + 1)) >= (i * max_column_count))
|
||||
{
|
||||
assert(false);
|
||||
}
|
||||
memcpy(&(array_out[row * max_column_count]),
|
||||
&(array_out[i * max_column_count]),
|
||||
(size_t) (*n + 1) * sizeof(LDBLE));
|
||||
}
|
||||
row_back_l[row] = i;
|
||||
row++;
|
||||
m1++;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user