1.3. Abridged Quick-Reference

Question to Radio Erivan: "Is Octave lacking a Quick Reference?" Answer: "No, Octave ships with a very nice 3 page Quick Reference card, but it only describes the interpreter, not the library-interface."

Coda has to fill in the gap. The library quick reference is called "abridged", which is a fancy word for "incomplete". According to the establisheed 80-20 rule, the reader will find 80% of the functions she needs for usual programming jobs. The missing 20% will take 80% of the total coding time to hunt down.

All methods listed in this section have public access specification. Therefore, we have dropped the public modifiers in the class' synopis.

To generate an up-to-date class reference using doxygen, issue the command

 doxygen -g octave-dox 
Edit octave-dox, set EXTRACT_ALL and RECURSIVE to YES and INPUT to the location of the Octave include files, e.g. /usr/include/octave-2.1.50. Now execute
doxygen octave-dox
to generate the documentation in ./html.

1.3.1. Types

We follow the old tradition from the days of Pascal and introduce first the types the Octave library works on.

Table 1-1. Types

TypeFilesDescription
octave_value_listoct-obj.h Heterogenous container that is used in passing arguments to and from a dynamicaly loadable extension. I.e. the parameters and return values of a loadable function are mapped onto octave_value_lists. See Section 1.3.2.
octave_valueov.h Single element of an octave_value_list, which can hold any of Octave's types.
octave_matrixov-re-mat.h Any of Octave's real-valued matrix (Matrix, DiagMatrix) or vector types (RowVector, ColumnVector).
octave_complex_matrixov-cx-mat.h Any of Octave's complex-valued matrix (ComplexMatrix, ComplexDiagMatrix) or vector types (ComplexRowVector, ComplexColumnVector).
octave_bool_matrixov-bool-mat.h ?
octave_char_matrixov-char-mat.h ?
octave_scalarov-scalar.h Real (double) valued, complex (Complex) valued, or boolean (bool) scalar.
RowVectoroct-obj.h, ov-re-mat.h, ov.h Real (double) valued row vector; works like a matrix with a single row.
ComplexRowVectoroct-obj.h, ov-cx-mat.h, ov.h Complex (double) valued row vector; works like a matrix with a single row.
ColumnVectoroct-obj.h, ov-re-mat.h, ov.h Real (double) valued column vector; works like a matrix with a single column.
ComplexColumnVectoroct-obj.h, ov-cx-mat.h, ov.h Complex (Complex) valued column vector; works like a matrix with a single column.
Matrixov-re-mat.h, Real (double) valued matrix.
ComplexMatrixov-cx-mat.h, Complex (Complex) valued matrix.
boolMatrix? Matrix of booleans (bool).
charMatrix? Matrix of characters (char).
DiagMatrixov-re-mat.h, ov.h Real (double) valued diagonal matrix.
ComplexDiagMatrixov-cx-mat.h, ov.h Complex (double) valued diagonal matrix.
Cell arrayov-cell.h, Cell.h, Cell array.

1.3.2. List Operations

.

{
octave_value_list();  octave_value_list(const T& t);octave_value& operator()(int index);  const octave_value operator()(int index);  const int length();  const bool empty();  octave_value_list& prepend(const octave_value& val);  octave_value_list& append(const octave_value& val);  octave_value_list& append(const octave_value_list& lst);  octave_value_list& reverse();  const octave_value_list& splice(int offset, int length, const octave_value_list& lst);  const octave_value_list& index(idx_vector& i);}

Most of the methods in octave_value_list are self explaining. The default constructor, splice, and index require some explanation.

Default Constructor. The default constructor makes an empty list. When an empty list is returned from a dynamically loaded extension, the function at the interpreter level behaves lieka procedure, i.e. returns "void" in other words returns nothing.

Converting Constructors. octave_value_list defines constructors for the following types T: double, Matrix, DiagMatrix, RowVector, ColumnVector, Complex, ComplexMatrix, ComplexDiagMatrix, ComplexRowVector, ComplexColumnVector, char*, std::string, string_vector, Range, and octave_value_list.

splice. Replaces length elements of the list, starting at offset, and then inserts lst. See also Octave documentation of splice.

index. Extract elements at the index values given by idx_vector i.

1.3.3. Access to Value

.

{
const bool bool_value();  const int int_value();  const int nint_value();  const double double_value();  const Complex complex_value();  const double scalar_value();  const std::string string_value();  const Range range_value();  const Octave_map map_value();  const octave_stream stream_value();  octave_function* function_value(bool silent);  const Cell cell_value();  const boolMatrix bool_matrix_value();  const Matrix matrix_value();  const ComplexMatrix complex_matrix_value();  const charMatrix char_matrix_value();  const octave_value_list list_value();}

1.3.4. Type Classification

.

{
const bool is_scalar_type();  const bool is_bool_type();  const bool is_complex_type();  const bool is_constant();  const bool is_numeric_type();  const bool is_range();  const bool is_real_scalar();  const bool is_real_type();  const bool is_string();  const bool is_matrix_type();  const bool is_char_matrix();  const bool is_complex_matrix();  const bool is_complex_scalar();  const bool is_real_matrix();  const bool is_all_va_args();  const bool is_builtin_function();  const bool is_cell();  const bool is_defined();  const bool is_dld_function();  const bool is_empty();  const bool is_function();  const bool is_list();  const bool is_magic_colon();  const bool is_map();  const bool is_stream();  const bool is_true();  const bool is_zero_by_zero();}