Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/mdsdescrip.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ typedef struct descriptor_a
*
* The multipliers block has the following format:
* char *a0; Address of the element whose subscripts are
* all zero int m [DIMCT]; Addressing coefficients (multipliers)
* all zero
* int m [DIMCT]; Addressing coefficients (multipliers)
*
* The bounds block has the following format:
* struct
Expand Down
33 changes: 23 additions & 10 deletions tdishr/TdiTrans.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ int Tdi1Trans(int opcode, int narg, mdsdsc_t *list[], mdsdsc_xd_t *out_ptr)
const mdsdsc_t *pmask = &one;
mds_signal_t *psig;
signal_maxdim tmpsig;
aflags_t aflags_default = {
.binscale = 0,
.redim = 1,
.column = 1,
.coeff = 0,
.bounds = 0,
};
array_bounds arr, *pa, *pd;
mdsdsc_xd_t sig[3] = {EMPTY_XD}, uni[3] = {EMPTY_XD}, dat[3] = {EMPTY_XD};
struct TdiCatStruct cats[4];
Expand Down Expand Up @@ -293,13 +300,16 @@ int Tdi1Trans(int opcode, int narg, mdsdsc_t *list[], mdsdsc_xd_t *out_ptr)
/** scalar to simple vector **/
if (rank == 0) {
memcpy((char *)&arr, (char *)pa, sizeof(struct descriptor));
arr.scale = 0;
arr.digits = 0;
arr.aflags = aflags_default;
arr.dimct = 1;
arr.aflags.coeff = 0;
arr.a0 = arr.pointer;
arr.arsize = arr.length;
arr.m[0] = 1;
arr.m[1] = 1;
arr.m[dim] = ncopies;
/* unused fields */
arr.a0 = arr.pointer;
arr.m[0] = ncopies; /* coeff */
arr.m[0 + 1] = 0; /* lower bound */
arr.m[0 + 2] = ncopies-1; /* upper bound */
}
/** simple and coefficient vector **/
else
Expand Down Expand Up @@ -337,13 +347,16 @@ int Tdi1Trans(int opcode, int narg, mdsdsc_t *list[], mdsdsc_xd_t *out_ptr)
/** scalar to simple vector **/
if (rank == 0) {
memcpy((char *)&arr, (char *)pa, sizeof(struct descriptor));
arr.scale = 0;
arr.digits = 0;
arr.aflags = aflags_default;
arr.dimct = 1;
arr.aflags.coeff = 0;
arr.a0 = arr.pointer;
arr.arsize = arr.length;
arr.m[0] = 1;
arr.m[1] = 1;
arr.m[dim] = ncopies;
/* unused fields */
arr.a0 = arr.pointer;
arr.m[0] = ncopies; /* coeff */
arr.m[0 + 1] = 0; /* lower bound */
arr.m[0 + 2] = ncopies-1; /* upper bound */
}
else if (rank >= MAX_DIMS)
status = TdiNDIM_OVER;
Expand Down
4 changes: 4 additions & 0 deletions tditest/testing/test-tdishr.ans
Original file line number Diff line number Diff line change
Expand Up @@ -5674,8 +5674,12 @@ lastloc(_M)
Byte_Unsigned([[0,0,0,0], [0,0,0,0], [0,0,0,1], [0,0,0,0]])
lastloc(_M,0)
Byte_Unsigned([[0,0,1,0], [0,0,1,0], [0,0,0,1], [0,0,0,0]])
replicate(2,0,3)
[2,2,2]
replicate([[2,4],[3,5]],1,3)
[[2,4], [3,5], [2,4], [3,5], [2,4], [3,5]]
spread(2,0,3)
[2,2,2]
spread([2,3,4],0,3)
[[2,2,2], [3,3,3], [4,4,4]]
trim(' A B ')
Expand Down
2 changes: 2 additions & 0 deletions tditest/testing/test-tdishr.tdi
Original file line number Diff line number Diff line change
Expand Up @@ -2986,7 +2986,9 @@ firstloc(_M)
firstloc(_M,0)
lastloc(_M)
lastloc(_M,0)
replicate(2,0,3)
replicate([[2,4],[3,5]],1,3)
spread(2,0,3)
spread([2,3,4],0,3)
#
# Functions implemented in TdiTrim.c
Expand Down