com.stata.sfi
Class Mata

java.lang.Object
  extended by com.stata.sfi.Mata

public final class Mata
extends Object

Routines for interacting with a Mata matrix.


Method Summary
static int getMataCol(String name)
          Get the number of columns in a Mata matrix.
static double[] getMataComp(String name)
          Read a complex Mata matrix.
static double[] getMataCompAt(String name, int row, int col)
          Read a complex Mata matrix entry.
static String getMataEltype(String name)
          Get the type of a Mata object.
static double[] getMataReal(String name)
          Read a real Mata matrix.
static double getMataRealAt(String name, int row, int col)
          Read a real Mata matrix entry.
static int getMataRow(String name)
          Get the number of rows in a Mata matrix.
static String[] getMataString(String name)
          Read a string Mata matrix.
static String getMataStringAt(String name, int row, int col)
          Read a string Mata matrix entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMataReal

public static double[] getMataReal(String name)
Read a real Mata matrix.

Parameters:
name - Name of the Mata matrix.
Returns:
A double array containing the matrix values. Returns null if error an error occurs.

getMataRealAt

public static double getMataRealAt(String name,
                                   int row,
                                   int col)
Read a real Mata matrix entry.

Parameters:
name - Name of the Mata matrix.
row - Row.
col - Column.
Returns:
Returns the entry. Returns a Stata missing if an error occurs.

getMataComp

public static double[] getMataComp(String name)
Read a complex Mata matrix.

Parameters:
name - Name of the Mata matrix.
Returns:
A double array containing the matrix values. Returns null if error an error occurs.

getMataCompAt

public static double[] getMataCompAt(String name,
                                     int row,
                                     int col)
Read a complex Mata matrix entry.

Parameters:
name - Name of the Mata matrix.
row - Row.
col - Column.
Returns:
A double[2] containing the entry. Returns null if error an error occurs.

getMataString

public static String[] getMataString(String name)
Read a string Mata matrix.

Parameters:
name - Name of the Mata matrix.
Returns:
A String array containing the matrix values. Returns null if error an error occurs.

getMataStringAt

public static String getMataStringAt(String name,
                                     int row,
                                     int col)
Read a string Mata matrix entry.

Parameters:
name - name of the Mata matrix.
row - Row.
col - Column.
Returns:
A String containing the matrix entry. Returns an empty String if error an error occurs.

getMataRow

public static int getMataRow(String name)
Get the number of rows in a Mata matrix.

Parameters:
name - Name of the Mata matrix.
Returns:
The number of rows. Returns -1 if an error occurs.

getMataCol

public static int getMataCol(String name)
Get the number of columns in a Mata matrix.

Parameters:
name - Name of the Mata matrix.
Returns:
The number of columns. Returns -1 if an error occurs.

getMataEltype

public static String getMataEltype(String name)
Get the type of a Mata object.

Parameters:
name - Name of the Mata matrix (not function).
Returns:
The eltype in string form of the Mata object. Returns an empty String if error occurs.