Created
October 5, 2012 13:59
-
-
Save AndrewTheTM/3839931 to your computer and use it in GitHub Desktop.
Voyager DLL main class Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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