Sign in to contribute to source. how it works

Type definition file stats.Matrix by barry

/*
{"description" : "Matrix manipulation functions."
}
*/
interface Matrix {
/*
{"@description" : "Adds matrix a to matrix b.",
"@return" : "The resulting matrix."
}
*/
dec[][] add(dec a[][], dec b[][])
/*
{"@description" : "Subtracts matrix a from matrix b.",
"@return" : "The resulting matrix."
}
*/
dec[][] subtract(dec a[][], dec b[][])
/*
{"@description" : "Multiplies matrix a by matrix b.",
"a" : "The [n][m] matrix to multiply.",
"b" : "The [m][q] matrix to multiply (m must be the same as in matrix a).",
"@return" : "The resulting matrix."
}
*/
dec[][] multiply(dec a[][], dec b[][])
/*
{"@description" : "Multiplies a matrix by a scalar value.",
"@return" : "The resulting matrix."
}
*/
dec[][] multiplyBy(dec a[][], dec b)
/*
{"@description" : "Negate a matrix.",
"@return" : "The resulting matrix."
}
*/
dec[][] negate(dec a[][])
/*
{"@description" : "Transpose a matrix (rows become columns).",
"@return" : "The resulting matrix."
}
*/
dec[][] transpose(dec a[][])
}

Revision history

To propose a new revision to this entity, use

`dana source put -ut your/new/version.dn -n stats.Matrix.Matrix -m "reason for update" -u yourUsername`

Version 1 (this version) by barry

Notes for this version: Standard Library Initialisation