Skip to content

Instantly share code, notes, and snippets.

@AndrewTheTM
Created October 5, 2012 13:59
Show Gist options
  • Save AndrewTheTM/3839931 to your computer and use it in GitHub Desktop.
Save AndrewTheTM/3839931 to your computer and use it in GitHub Desktop.
Voyager DLL main class Java
public static void main(String[] args) {
try{
voyagerDLL vdll=voyagerDLL.INSTANCE;
String err="";
int errB=256;
Pointer state=vdll.MatReaderOpen("C:\\Modelrun\\05e05i05i05aV76_Validation\\VEHTRPAM.MAT", err, errB);
int nMats=vdll.MatReaderGetNumMats(state);
int Zones=vdll.MatReaderGetNumZones(state);
String[] matNames=new String[nMats];
int names=vdll.MatReaderGetMatrixNames(state, matNames);
double[] rowBuffer=new double[Zones+1];
int mrgr=0;
for(int t=1;t<=nMats;t++){
for(int i=1;i<=Zones;i++){
mrgr=vdll.MatReaderGetRow(state, t, i, rowBuffer);
for(int j=0;j<Zones;j+=100){
System.out.println("Table="+t+" I="+i+" J="+j+" Val="+rowBuffer[j]);
}
}
}
vdll.MatReaderClose(state);
System.out.println("Complete!");
}catch (Exception e){
e.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment