Changeset 22689


Ignore:
Timestamp:
04/11/18 18:27:34 (7 years ago)
Author:
dlcheng
Message:

CHG (JS): Adding missing JS WriteData for IssmSeqVec.

Location:
issm/trunk-jpl/src/wrappers/javascript/io
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/wrappers/javascript/io/WriteJavascriptData.cpp

    r19838 r22689  
    7878}
    7979/*}}}*/
     80/*FUNCTION WriteData(IssmPDouble* pdouble, IssmSeqVec<double> vector){{{*/
     81void WriteData(IssmPDouble** pdataref, IssmSeqVec<double>* vector){
     82
     83    double*  dataref=NULL;
     84    double*  vector_ptr=NULL;
     85    int      rows;
     86
     87    if(vector){
     88        /*call toolkit routine: */
     89        vector_ptr=vector->ToMPISerial();
     90        vector->GetSize(&rows);
     91
     92        /*now create the js vector */
     93                dataref=xNew<double>(rows);
     94        for(int i=0;i<rows;i++) dataref[i]=vector_ptr[i];
     95    }
     96
     97    /*Clean-up and return*/
     98    xDelete<double>(vector_ptr);
     99    *pdataref=dataref;
     100}
     101/*}}}*/
    80102/*FUNCTION WriteData(IssmPDouble* pdouble, IssmPDouble double){{{*/
    81103void WriteData(IssmPDouble* pdouble, IssmPDouble doublein){
  • issm/trunk-jpl/src/wrappers/javascript/io/javascriptio.h

    r19838 r22689  
    2525void WriteData(char** pstring, char* stringin);
    2626void WriteData(IssmPDouble* pdouble, IssmPDouble doublein);
     27void WriteData(IssmPDouble** pdataref, IssmSeqVec<double>* vector);
    2728void WriteData(IssmPDouble** pdouble, void*);
    2829
Note: See TracChangeset for help on using the changeset viewer.