Skip to content

Commit

Permalink
fix compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
eve70a committed Apr 23, 2024
1 parent fa312f3 commit 0a4967d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/basis_cexample.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ int main(int argc, char* argv[])
udata[3]=1.00;
gsCMatrix * u = gsMatrix_create_rcd(1,4,udata);
gsCMatrix * result = gsMatrix_create();
eval_into(b, u, result);
gsFunctionSet_eval_into(b, u, result);
printf("Matrix with %d rows and %d columns:\n", rows(result), cols(result) );
print(result);
printf("\n");
Expand Down
4 changes: 2 additions & 2 deletions examples/geometry_cexample.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int main(int argc, char* argv[])
// evaluate positions (x,y,z) at given parameter values

gsCMatrix * out_p = gsMatrix_create();
eval_into(G, uvm, out_p);
gsFunctionSet_eval_into(G, uvm, out_p);
double* out_data = data(out_p);
int out_rows = rows(out_p), out_cols = cols(out_p);

Expand All @@ -71,7 +71,7 @@ int main(int argc, char* argv[])

// evaluate first derivatives d(x,y,z)/du and d(x,y,z)/dv at given parameter values
gsCMatrix * out_d = gsMatrix_create();
deriv_into(G, uvm, out_d);
gsFunctionSet_deriv_into(G, uvm, out_d);
out_data = data(out_d);
out_rows = rows(out_d);
out_cols = cols(out_d);
Expand Down
16 changes: 8 additions & 8 deletions src/Cgismo.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,39 @@
#define rows(X) _Generic((X), \
gsCVector * : gsVector_rows, \
gsCVectorInt *: gsVectorInt_rows, \
gsCMatrix * : gsMatrix_rows,
gsCMatrix * : gsMatrix_rows, \
gsCMatrixInt *: gsMatrixInt_rows)(X)

#define cols(X) _Generic((X), \
gsCVector * : gsVector_cols, \
gsCVectorInt *: gsVectorInt_cols, \
gsCMatrix * : gsMatrix_cols,
gsCMatrix * : gsMatrix_cols, \
gsCMatrixInt *: gsMatrixInt_cols)(X)

#define data(X) _Generic((X), \
gsCVector * : gsVector_data, \
gsCVectorInt *: gsVectorInt_data, \
gsCMatrix * : gsMatrix_data,
gsCMatrix * : gsMatrix_data, \
gsCMatrixInt *: gsMatrixInt_data)(X)

#define transposeInPlace(X) _Generic((X), \
gsCVector * : gsVector_transposeInPlace, \
#define transposeInPlace(X) _Generic((X), \
gsCVector * : gsVector_transposeInPlace, \
gsCVectorInt *: gsVectorInt_transposeInPlace, \
gsCMatrix * : gsMatrix_transposeInPlace,
gsCMatrix * : gsMatrix_transposeInPlace, \
gsCMatrixInt *: gsMatrixInt_transposeInPlace)(X)

#define setZero(X) _Generic((X), \
gsCVector * : gsVector_setZero, \
gsCVectorInt *: gsVectorInt_setZero, \
gsCMatrix * : gsMatrix_setZero,
gsCMatrix * : gsMatrix_setZero, \
gsCMatrixInt *: gsMatrixInt_setZero)(X)

#define destroy(X) _Generic((X), \
gsCFunctionSet * : gsFunctionSet_delete, \
gsCKnotVector * : gsKnotVector_delete, \
gsCVector * : gsVector_delete, \
gsCVectorInt * : gsVectorInt_delete, \
gsCMatrixInt * : gsMatrixInt_delete,
gsCMatrixInt * : gsMatrixInt_delete, \
gsCMatrix * : gsMatrix_delete)(X)

#endif // CGISMO_H

0 comments on commit 0a4967d

Please sign in to comment.