Core Datastructures

class NTPolySwig.MatrixMemoryPool_r(columns, rows)

A memory pool datatype that can be reused for matrix matrix multiplication this is to prevent excessive alloc/dealloc.

property thisown

The membership flag

class NTPolySwig.MatrixMemoryPool_c(columns, rows)

A memory pool datatype that can be reused for matrix matrix multiplication this is to prevent excessive alloc/dealloc.

property thisown

The membership flag

class NTPolySwig.Matrix_lsr(*args)

A datatype for storing a CSR matrix (real values).

Dot(matB)

Matrix dot product.:type matB: Matrix_lsr

Parameters:

matB – matrix to dot with.:rtype: float

Returns:

the dot product of this and matB.

ExtractColumn(column_number, column_out)

Extract a column from the matrix into the compressed vector representation:type column_number: int

Parameters:
  • column_number – the column to extract:type column_out: Matrix_lsr

  • column_out – the matrix representing that column

ExtractRow(row_number, row_out)

Extract a row from the matrix into the compressed vector representation.:type row_number: int

Parameters:
  • row_number – the row to extract:type row_out: Matrix_lsr

  • row_out – the matrix representing that row

Gemm(matA, matB, isATransposed, isBTransposed, alpha, beta, threshold, memory_pool)

This := alpha*matA*op( matB ) + beta*this:type isATransposed: boolean

Parameters:
  • isATransposed – true if A is already transposed.:type isBTransposed: boolean

  • isBTransposed – true if B is already transposed.:type alpha: float

  • alpha – scaling value.:type beta: float

  • beta – scaling value.:type threshold: float

  • threshold – for flushing small values.:type memory_pool: MatrixMemoryPool_r

  • memory_pool – a memory pool to use for storing intermediates.

GetColumns()

Get the number of columns in a matrix.

GetRows()

Get the number of rows in a matrix.

Increment(matB, alpha, threshold)

This = alpha*MatrixB + This(AXPY).:type matB: Matrix_lsr

Parameters:
  • matB – matrix to add.:type alpha: float

  • alpha – scale for the matrix.:type threshold: float

  • threshold – for flushing small values.

MatrixToTripletList(triplet_list)

Compute a triplet list from the entries in a matrix.:type triplet_list: TripletList_r

Parameters:

triplet_list – output.

PairwiseMultiply(matA, matB)

Pairwise multiply two sparse matrices.:type matB: Matrix_lsr

Parameters:

matB

Print()

Print the sparse matrix to the console.

Scale(constant)

Scale the matrix by a constant.:type constant: float

Parameters:

constant – value to scale by.

Transpose(matA)

Transpose a sparse matrix.

WriteToMatrixMarket(file_name)

Write the sparse matrix to file.:type file_name: string

Parameters:

file_name – file to print to.

property thisown

The membership flag

class NTPolySwig.Permutation(matrix_dimension)

A data structure for storing permutations.

SetDefaultPermutation()

Fills the load balancer with a default schedule.

SetRandomPermutation()

Fills the load balancer with a random schedule.

SetReversePermutation()

Fills the load balancer with a reverse schedule.

property thisown

The membership flag

class NTPolySwig.Triplet_r

A Class For Storing Triplets of Integer, Integer, Double.

property index_column

Column location.

property index_row

Row location.

property point_value

Value at that location.

property thisown

The membership flag

class NTPolySwig.Triplet_c

A Class For Storing Triplets of Integer, Integer, complex<Double>.

property index_column

Column location.

property index_row

Row location.

property point_value

Value at that location.

property thisown

The membership flag

class NTPolySwig.TripletList_r(size=0)

A data type for a list of triplets. As this is related to matrix multiplication, the referencing indices are rows and columns.

Append(value)

Add a value to the end of the triplet list.:type value: Triplet_r

Parameters:

value – the triplet value to append.

GetSize()

Get the number of entries in a triplet list.:rtype: int

Returns:

the number of entries in the list.

GetTripletAt(index)

Get the triplet value at a given index.:type index: int

Parameters:

index – location to get the triplet at.

Resize(size)

Increase the size of a triplet list.:type size: int

Parameters:

size – the new size.

SetTripletAt(index, value)

Set a triplet value.:type index: int

Parameters:
  • index – location to set the triplet at.:type value: Triplet_r

  • value – the triplet value to set.

static SortTripletList(list, matrix_columns, sorted)

Sort a triplet list:type list: TripletList_r

Parameters:
  • list – to be sorted.:type matrix_columns: int

  • matrix_columns – this is the highest column value in the list:type sorted: TripletList_r

  • sorted – a now sorted version of the list.

property thisown

The membership flag

class NTPolySwig.TripletList_c(size=0)

A data type for a list of triplets. As this is related to matrix multiplication, the referencing indices are rows and columns.

Append(value)

Add a value to the end of the triplet list.:type value: Triplet_c

Parameters:

value – the triplet value to append.

GetSize()

Get the number of entries in a triplet list.:rtype: int

Returns:

the number of entries in the list.

GetTripletAt(index)

Get the triplet value at a given index.:type index: int

Parameters:

index – location to get the triplet at.

Resize(size)

Increase the size of a triplet list.:type size: int

Parameters:

size – the new size.

SetTripletAt(index, value)

Set a triplet value.:type index: int

Parameters:
  • index – location to set the triplet at.:type value: Triplet_c

  • value – the triplet value to set.

static SortTripletList(list, matrix_columns, sorted)

Sort a triplet list:type list: TripletList_c

Parameters:
  • list – to be sorted.:type matrix_columns: int

  • matrix_columns – this is the highest column value in the list:type sorted: TripletList_c

  • sorted – a now sorted version of the list.

property thisown

The membership flag