28 #ifdef __INTEL_COMPILER 29 void hsx_equus_mp_read_hsx_(
char* fname,
long *fname_len,
EQstruct* eq_struct);
52 int nrhs,
const mxArray *prhs[])
66 mexErrMsgIdAndTxt (
"siesta_EQuUs:hsx_m:nInput",
"One input required.");
69 mexErrMsgIdAndTxt (
"siesta_EQuUs:hsx_m:nOutput",
"Too many output arguments.");
75 if ((mxIsChar(prhs[0]) != 1)) {
76 mexErrMsgIdAndTxt (
"siesta_EQuUs:hsx_m:NonString",
"Input must be a string.");
80 buflen = (mxGetM(prhs[0]) * mxGetN(prhs[0])) + 1;
84 filename = mxArrayToString(prhs[0]);
86 mexPrintf(
"%s\n", filename );
89 if (access(filename, F_OK) == -1) {
90 mexErrMsgIdAndTxt (
"siesta_EQuUs:hsx_m:FileNotExist",
"The given file %s does not exist.", filename);
98 #ifdef __INTEL_COMPILER 99 hsx_equus_mp_read_hsx_( filename, &buflen, &eq_hsx);
108 plhs[0] = mxCreateStructMatrix(1, 1, eq_hsx.
numfields, (
const char**)fieldnames);
111 mexPrintf(
"\nSetting the fields\n*********************************\n" );
114 for( idx=0; idx<eq_hsx.
numfields; idx++ ) {
116 mexPrintf(
"setting field: %s:\n", fieldnames[idx] );
Header file for felper functions for interlanguage conversions.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Gateway routine to read in the hsx structure generated by the SIESTA package (see http://www....
char ** getFieldnames(EQstruct *eq_struct)
Get all the element names stored in the eq_struct structure prototype.
void setField(EQelement *eq_field, mxArray *Mstruct)
Set a field in a MATLAB structure.
void __hsx_equus_MOD_read_hsx(char *fname, long *fname_len, EQstruct *eq_struct)
====================================================================== Gateway routine to read in the...