Welcome in the CMatrix Module. This module, written with python and Cython, is as fast as a c/c++ Librairie file. It has been thinked for Matrix complex computation. This Module have been splitted into three main parts :

• A Matrix Generators Section The Matrix Generators section permit to generate automatically standard algebrica matrix as :

-A Laplacian mean Matrx To read a matrix from an external file, you can use the Matrix Getter py file into the main github repository to extract and use any matrix with this lib. It contains differents kind of function :

-Primary utility functions as Ribbon converter, usual operators, . . .

-Middle level functions as Matrix extraction/recognition, usuals algebrica operations, . . .

-Hard level functions as Strassen algorithm, Convolutions, System resolution, Tensorial operations, . . .

The full description of each part is avaible on the left tree entries. All the functions are documented and a small example will be used as an Usage Guide.

Here you will find the main Scheme to have a global look on this module.

CONTENTS:

INTRODUCTION

Here is my new version of the matrix library including sequence recognition algorithm as compressor. To setup manually :

• Install all prerequires as following :

-Get python3.8 from www.python.org -pip install sphinx -pip install numpy -pip install random -pip install cython -pip install sphinxcontrib-napoleon -pip install sphinx-autoapi

• Compile the cmatrix.pyx file using the command : python setup.py build_ext -inplace

• compile the associated html file using the command: .make html Chapter 1. Introduction

CHAPTER

TWO MATRIX USAGE QUICK START

Here, you will find all the basics operations computed from the redefined python function.

Add function

Ad hoc polymorphism 'add' function

Parameters Type Description mat

Matrix The matrix to add

Returns

Matrix The sum of the self matrix and the mat arg matrix

Examples

Sub function

Ad hoc polymorphism 'sub' function

Parameters Type Description mat

Matrix The matrix to sub

Returns

Matrix The difference between the self matrix and the mat arg matrix

Examples

Mul function

Returns

Matrix

The product between the self matrix and the argument, depending of argument type :

• Matrix mean a matrix product

• integer mean a lambda product

• double mean a lambda product

Examples

Mod function

Returns

bint Return the test of non-equality between the self matrix and the mat argument.

Le function

Returns

bint Return the test less or equal between the length of the self matrix and the length of mat argument.

Ge function

Returns

bint Return the test less than between the length of the self matrix and the length of mat argument.

Examples

THREE API FUNCTIONS

Here, you will find relative documentation about utilitary functions, containing an algorithm of sequence recognization.

Matrix generators

Here the matrix generators with automatically memory allocation.

cmatrix.Laplacian_mean

Laplacian mean matrix generator.

cmatrix.gaussian

Generate Gaussian square base matrix.

cmatrix.mean_filter

Generate a mean filter matrix.

cmatrix.rand_perm

Generate a random permutation matrix size x size cmatrix.unit Generate the unit matrix.

cmatrix.zeros

Generate the zeros matrix. Can be used as a generator of differents gaussian "filter type" matrix using an additionnal function mapped to each value (to convolve self matrix for example).

cmatrix.Laplacian_mean

Two mode are avaible :

• 0 => binomial distribution

Examples

>>> for i in range(0,10): ... print(Pascal_triangle(i)) ... , 5, 10, 10, 5, 1] [1, 6, 15, 20, 15, 6, 1] [1, 7, 21, 35, 35, 21, 7, 1] [1, 8, 28, 56, 70, 56, 28, 8, 1] 3.2.7 cmatrix.reverse cmatrix.reverse() I think comments are not necessary for this function.

[1] [1, 1] [1, 1] [1, 2, 1] [1, 3, 3, 1] [1, 4, 6, 4, 1] [1

cmatrix

Sequence recognition algorithm

Here, the sequence recognization algorithm. The algorithm is working in three steps:

• From the original data as raw list, I create mutants list containing all the subset of the main list • I consider each mutant as a claiming sequence • I verifiy and count (if verified) the number of repetition

cmatrix.count_seq

Count the number of sequences repetiotion in the given data segment as list.

cmatrix.create_mutants

Create the 'mutants lists' from the original one.

cmatrix.cut

Cut the liste from the pivot (as double argument).

cmatrix.find_invariant

Find the invariant part since the beggining until the sequence repetitions start.

cmatrix.find_max

Search into the list of list containing all the claiming sequences the longest one.

cmatrix.find_mul_seq

The main sequence finder algorithm.

cmatrix.find_seq

Search a sequence into the parameter list.

cmatrix.find_seq_in_list

Test if the given sequence have been found in the raw data (given as list) cmatrix.split_data A data splitter to treat a large amount of data.

cmatrix.split_number

Split a number by heigth in decimal base.

cmatrix.count_seq cmatrix.count_seq()

Count the number of sequences repetiotion in the given data segment as list.

Parameters type Description liste list

The liste containing the given sequence seq list The sequence as list

Returns int

The number of repetition of the sequence in da list

Examples

>>> l= [1,2,3,7,3,4,7,3,4,7,3,4] >>> seq= [7,3,4] >>> count_seq(l,seq) 3

cmatrix.create_mutants cmatrix.create_mutants()

Create the 'mutants lists' from the original one.

Two mode are avaible :

• Mutants created from the begin ,2,3,4,5,6,7] >>> create_mutants(l) [[2, 3, 4, 5, 6, 7], [3,4,5,6,7], [4,5,6,7], [5,6,7] ,2,3,5,6,3,5,6,3,5,6] >>> m=create_mutants(l) >>> print(m) [[2, 3, 5, 6, 3, 5, 6, 3, 5, 6], [3,5,6,3,5,6,3,5,6], [5, 6, 3, 5, 6, 3, ˓→5, 6], [6,3,5,6,3,5,6], [3,5,6,3,5,6], [5,6,3,5,6], [6,3,5,6], , 3, 5, 6, 3, 5, 6, 3, 5, 6] 3.3.6 cmatrix.find_mul_seq cmatrix.find_mul_seq()

˓→ [3, 5, 6], [5, 6], [6]] >>> find_max(m) [2
The main sequence finder algorithm. Return the sequence (if founded) with number of repetition. First thinked as data compressor, it should be used as ARN/ADN sequence analizer :) The algorithm use the various microfunction written above.

Parameters type Description liste list

The raw data to treat as list

Returns

tuple A tuple containing the sequence as list and the number of repetition as int (if found)

See also: ,3,7,3,4,7,3,4,7,3,4] >>> m=[4,2,1,4,2,1,4,2,1,5,7,9] >>> n= [1,2,6,4,5,6,4,5,6,4,5,8,3,9] >>> find_mul_seq(l) ([7, 3, 4], 3) 6,4,5], 3) 30 Chapter 3. API Functions

create_mutants() find_seq_in_list() count_seq() suppr_double() find_max()
Examples >>> l=[1,2
>>> find_mul_seq(m) ([4, 2, 1], 3) >>> find_mul_seq(n) ([

cmatrix.find_seq cmatrix.find_seq()

Search a sequence into the parameter list. This is the first naïve step of the algorithm.

Parameters type Description liste list

The raw data to treat as list Returns list A list containing the sequence repeated from the begining to the end if found

See also:

find_seq_in_list() • False => The sequence hasn't been found ,3,4,5,3,7,5,3,7,5,3,7,5

Examples >>> find_seq([1,2,3,1,2,3,1,2,3]) [1, 2, 3]
Examples >>> seq=[3,7,5] >>> l=[1,2

-

  Recognition Section This Sequence Recognition Algorithm permit us to find in any list any repeated sequence from nothing . This Algorithm is splitted into 10 functions : 1 main algorithm and 9 sub-function. The main algorithm function name is find_mul_seq, meaning Find Multiples Seqneces function. The 9 sub-functions used to make it works are :-count_seq : A sequence counter -create_mutants : A list mutants generator function -cut : A list cutter function -find_invariant : An invariant finder function -find_max : Get the max length list function -find_seq : A sequence finder function -find_seq_in_list : An advanced sequence finder function -split_data : Data splitter function -split_number : A number splitter function • The Main Matrix Engine The main matrix engine define an new Matrix Object into your Python code. This matrix should be extracted and readed from :

  cmatrix.Laplacian_mean()Laplacian mean matrix generator. The order have been programmed until 3.Parameters typeDescription order int the order of the computed laplacian Returns Matrix The laplacian mean matrix See also: 004 | -0.008 | -0.016 | -0.008 | -0.004 | | -0.008 | -0.016 | -0.031 | -0.016 | -0.008 | | -0.016 | -0.031 | +0.062 | -0.031 | -0.016 | | -0.008 | -0.016 | -0.031 | -0.016 | -0.008 | | -0.004 | -0.008 | -0.016 | -0.008 | -0.004 | printed 3.1.2 cmatrix.gaussian cmatrix.gaussian() Generate Gaussian square base matrix.

  Test if the given sequence have been found in the raw data (given as list) The sequence has been found

  Swap the two given columns of the self matrix object from the given a and b index

8 Chapter 2. Matrix Usage Quick Start 2.5.3 See Also

	cmatrix.Matrix.op()
	2.6 Neg function
	Genericity polymorphism 'neg' function
	2.6.1 Returns
	Matrix The opposite Matrix from self
	2.6.2 Examples
	>>> m=rand(3)
	>>> print(m)
	| +5.000 | +0.000 | +7.000 |
	| +9.000 | +4.000 | +8.000 |
	| +9.000 | +4.000 | +6.000 |
	printed Genericity polymorphism 'mod' function >>> print(-m)
	| -5.000 | -0.000 | -7.000 |
	Parameters Type | -9.000 | -4.000 | -8.000 |	Description
	value | -9.000 | -4.000 | -6.000 |	double The modulo value
	printed	value		int The modulo value
	2.5.1 Returns
	Matrix The modulo matrix
	2.5.2 Examples
	>>> m=rand(4)
	>>> print(m)
	| +12.000 | +5.000 | +10.000 | +5.000 |
	| +9.000 | +10.000 | +2.000 | +2.000 |
	| +10.000 | +9.000 | +0.000 | +2.000 |
	| +13.000 | +9.000 | +8.000 | +16.000 |
	printed
	>>> print(m%2)
	| +0.000 | +1.000 | +0.000 | +1.000 |
	| +1.000 | +0.000 | +0.000 | +0.000 |
				(continues on next page)

2.6.3 See Also

	cmatrix.Matrix.op()
	2.7 Str function
	Genericity polymorphism 'str' function
	2.6

. Neg function 2.7.1 Examples

	>>> m=rand(4)
	>>> print(m)
	| +7.000 | +9.000 | +14.000 | +3.000 |
	| +0.000 | +7.000 | +14.000 | +12.000 |
	| +2.000 | +12.000 | +11.000 | +7.000 |
	| +3.000 | +16.000 | +11.000 | +7.000 |
	printed
	2.7.2 See Also
	cmatrix.Matrix.Print()
	2.8 Len function
	Genericity polymorphism 'len' function
	2.8.1 Examples
	>>> m=rand(4)
	>>> len(m)
	16
	2.9 Getitem function
	Genericity polymorphism 'getitem' function.
	Parameters type	Description
	key	tuple	i,j values
	key	tuple of tuple (i,j),(k,l) values (in case of submatrix extraction)
	2.9.1 Returns
	double The (i,j) item from the self Matrix
	Matrix the (i,j) => (k,l) sub matrix extracted from self Matrix

10 Chapter 2. Matrix Usage Quick Start 2.9.2 Examples

	>>> m=rand(4)
	>>> print(m)
	| +9.000 | +13.000 | +5.000 | +15.000 |
	| +12.000 | +6.000 | +5.000 | +4.000 |
	| +2.000 | +5.000 | +4.000 | +2.000 |
	| +15.000 | +15.000 | +8.000 | +9.000 |
	printed
	>>> m[0,0]
	9.0
	>>> print(m[(0,0),(2,2)])
	| +9.000 | +13.000 |
	| +12.000 | +6.000 |
	printed
	2.9.3 See Also
	cmatrix.Matrix.get_ij() cmatrix.Matrix.xtract_sub_matrix()
	2.10 Setitem function
	Genericity polymorphism 'setitem' function
	Parameters type	Description
	key	tuple	i,j values
	value	double the value to set
	value	Matrix the sub-matrix to set from (i,j) arg

2.10.1 Returns Matrix The self matrix updated with new value(s) 2.10.2 Examples

	>>> m=Matrix(4,4) >>> insert=rand(2) >>> print(insert) | +3.000 | +4.000 | | +3.000 | +1.000 | printed >>> m[0,0]=insert >>> print(m) | +3.000 | +4.000 | +0.000 | +0.000 | | +3.000 | +1.000 | +0.000 | +0.000 | | +0.000 | +0.000 | +0.000 | +0.000 | | +0.000 | +0.000 | +0.000 | +0.000 | printed >>> m[3,3]=10.123456 | +3.000 | +4.000 | +0.000 | +0.000 | | +3.000 | +1.000 | +0.000 | +0.000 | | +0.000 | +0.000 | +0.000 | +0.000 | | +0.000 | +0.000 | +0.000 | +10.123 | printed 2.10.3 See Also cmatrix.set_ij() cmatrix.insert_sub_matrix() 2.11 Eq function Genericity polymorphism 'eq' function Parameters type Description mat Matrix The matrix to test 2.11.1 Returns bint Return the test of equality between the self matrix and the mat argument. 2.11.2 Examples >>> m=rand(3) >>> n=m.clone() >>> print(m==n) 2.10. Setitem function >>> print(m) True	(continues on next page)

2.11.3 See Also

	2.12.1 Examples
	>>> m=rand(3)
	>>> n=rand(3)
	>>> print(m==n)
	False
	cmatrix.Matrix.same_size()	cmatrix.Matrix.size_r()	cmatrix.Matrix.size_c()
	cmatrix.Matrix.get_ij()
	2.12 Ne function
	Genericity polymorphism 'ne' function
	Parameters type	Description
	mat	Matrix The matrix to test
	12		Chapter 2. Matrix Usage Quick Start

  Return the test greater or equal between the length of the self matrix and the length of mat argument.

	2.14.2 Examples
	>>> m=rand(4)
	>>> n=rand(3)
	>>> print(m>=n)
	True
	>>> print(n>=m)
	False
	2.15 Lt function

Genericity polymorphism 'ge' function Parameters type Description mat Matrix The matrix to test 2.13. Le function 2.14.1 Returns bint Genericity polymorphism 'lt' function Parameters type Description mat Matrix The matrix to test

Matrix Usage Quick Start 2.16.1 Returns bint

  Return the test greater than between the length of the self matrix and the length of mat argument.

	>>> m=rand(4) >>> n=rand(3) >>> print(n<m) True >>> print(m<n) False 2.16 Gt function Genericity polymorphism 'gt' function Parameters type mat Matrix The matrix to test Description 14 >>> m=rand(4) >>> n=rand(3) >>> print(m>n) True >>> print(n>m) False 2.17 Contains function >>> m=rand(3) >>> main=Matrix(5,5) >>> main[1,1]=m >>> print(main) | +0.000 | +0.000 | +0.000 | +0.000 | +0.000 | | +0.000 | +9.000 | +6.000 | +7.000 | +0.000 | | +0.000 | +6.000 | +6.000 | +4.000 | +0.000 | | +0.000 | +1.000 | +3.000 | +1.000 | +0.000 | | +0.000 | +0.000 | +0.000 | +0.000 | +0.000 | printed >>> print(m) | +9.000 | +6.000 | +7.000 | | +6.000 | +6.000 | +4.000 | | +1.000 | +3.000 | +1.000 | printed >>> print(m in main) True >>> n=rand(3) >>> print(n) | +5.000 | +9.000 | +9.000 | | +8.000 | +8.000 | +1.000 | | +7.000 | +3.000 | +0.000 | Chapter 2. 2.16.2 Examples printed

Genericity polymorphism 'contains' function Parameters type Description mat Matrix The matrix to test 2.17.1 Returns bint Return the appartenance test (x in A) wher x i the submatrix mat as arguement and A is the self matrix 2.17.2 Examples (continues on next page) 2.17. Contains function (continued from previous page) >>> print(n in main) False 2.17.3 See Also op() 16 Chapter 2. Matrix Usage Quick Start CHAPTER

  Get the absolute value of the given argument.

	Examples >>> m=rand_perm(4) >>> print(m) | +0.000 | +0.000 | +0.000 | +1.000 | | +0.000 | +1.000 | +0.000 | +0.000 | | +0.000 | +0.000 | +1.000 | +0.000 | | +1.000 | +0.000 | +0.000 | +0.000 | printed 3.1.5 cmatrix.unit 20 cmatrix.unit() Generate the unit matrix. Parameters Type Description size int the size of the square matrix Chapter 3. API Functions Returns Matrix The unit matrix See also: set_ij() Examples >>> u=unit(4) >>> print(u) | +1.000 | +0.000 | +0.000 | +0.000 | | +0.000 | +1.000 | +0.000 | +0.000 | | +0.000 | +0.000 | +1.000 | +0.000 | | +0.000 | +0.000 | +0.000 | +1.000 | printed 3.1.6 cmatrix.zeros cmatrix.zeros() Generate the zeros matrix. Parameters type Description size_r int the row size size_c int the columns size Returns Matrix The zeros matrix Examples 3.2 Utilitary Here, the utilitary functions definitions and usage. cmatrix.abs Get the absolute value of the given argument. cmatrix.complement Return the x complement in the given base (generic al-gorithm). cmatrix.complement_at Utility function computing the complement from x and base. cmatrix.isalpha Test if the given arguments is alphanum. cmatrix.mirror Local util mirror constructor to Pascal triangle genera-tor. cmatrix.Pascal_triangle Pascal triangle generator of dimension dim. cmatrix.reverse I think comments are not necessary for this function. cmatrix.swap Swap a and b as double values. cmatrix.switch Redefined C-like switch. cmatrix.timeit Time a function using @timeit syntax. cmatrix.tri 3.2.1 cmatrix.abs cmatrix.abs() Parameters type Description x double The raw value to treat Returns double The absolute value of x Examples >>> m=-123 >>> n=123 >>> abs(m) 123 >>> abs(n) 123 3.2.2 cmatrix.complement cmatrix.complement() Return the x complement in the given base (generic algorithm). 22 Chapter 3. API Functions Parameters type Description x int The value to complement base int The numeric base as reference (2 by default) Returns double The x complement in given base See also: split_number() complement_at() Examples >>> num=123456 >>> base=10 >>> cp=complement(num,base) >>> print(cp) 876543 >>> num=11100101 >>> base=2 >>> cp=complement(num,base) >>> print(cp) 11010 3.2.3 cmatrix.complement_at cmatrix.complement_at() Utility function computing the complement from x and base. Parameters type Description x int the value to base-complement base int the numeric base as reference (2 by default) Returns int the 1st level complement (on one digit) >>> base=10 >>> cp=complement_at(num,base) >>> print(cp) 2 >>> num=2 >>> base=3 >>> cp=complement_at(num,base) >>> print(cp) 0 3.2.4 cmatrix.isalpha cmatrix.isalpha() Test if the given arguments is alphanum. Returns Bool The tested condition 3.2.5 cmatrix.mirror Parameters Type Description array int list The list containing the first half of the binomial coefficients suit. dim int The dimension of the binomial coefficients suit. Returns list Pascal triangle mirror line from an half size one Examples >>> mirror([1,3],4) [1, 3, 3, 1] 3.2.6 cmatrix.Pascal_triangle cmatrix.Pascal_triangle() Pascal triangle generator of dimension dim. Parameters Type Description dim int Dimension of the triangle Returns int list Binomial coefficients computed. 24 Chapter 3. API Functions See also: 3.2. Utilitary Examples >>> num=7 mirror()

cmatrix.mirror()

Local util mirror constructor to Pascal triangle generator.

.10 cmatrix.timeit

  Redefined C-like switch. Could also be used as an inverse switch where x is a value and arg the differents variables to test.

	3.2.9 cmatrix.switch Examples
	cmatrix.switch() >>> from matrix import *
	>>> @timeit
	... def isalpha(char):
	...	return (char in ['0','1','2','3','4','5','6','7','8','9'])
	Parameters ... x >>> isalpha('9') arg <function isalpha at 0x0337B6F0> executed 10 000 times in 0.011322021484375 = 1. Type Description string the variable name to switch string/generic ˓→1322021484375e-06 /s.
	True		the differents states to switch, defined mod 2 :
			"string",function,"string",function,. . .
	Returns 3.2.11 cmatrix.tri
	Generic The function or action corresponding to the switch entry. cmatrix.tri()
	Examples
	>>> test1=False
	>>> test2=False
	>>> test3=True
	>>> test4=False
	>>> val=switch(True,
	...	test1,1,
	...	test2,2,
	... ...	test3,3, .swap test4,4)
	>>> print(val)
	cmatrix.swap() 3
	Swap a and b as double values. >>> val=switch(test3,
	...	True,3,
	... >>> print(val) False,4) 3	Parameters type a double value to swap Description b double value to swap
	Returns tuple the swapped values 3.2cmatrix.timeit()
	Examples Time a function using @timeit syntax.
		Parameters Type	Description
	>>> from cmatrix import * >>> a=123 func	Function The function to be stopwatch
	>>> b=456
	>>> swap(a,b) Returns
	(456.0, 123.0) Executed decorated function with originals arguments
	26		Chapter 3. API Functions

  Cut the liste from the pivot (as double argument). Search into the list of list containing all the claiming sequences the longest one.

	, [6, 7], [7]] Chapter 3. API Functions double The pivot value as cutter delimiter Parameters type Description liste list The liste to cut piv list The cutted list from the pivot value 3.3.3 cmatrix.cut 28 cmatrix.cut() Returns Examples >>> l=[1,2,3,4,5,6] >>> piv=3 >>> cut(l,piv) [3, 4, 5, 6] 3.3.4 cmatrix.find_invariant Parameters type Description liste list the raw data as list seq list the sequence found in the data list Returns list A list containing the unsequenced begining of liste Examples >>> n=[1,2,6,4,5,6,4,5,6,4,5,8,3,9] >>> seq=[6,4,5] >>> find_invariant(n,seq) [1, 2] 3.3.5 cmatrix.find_max cmatrix.find_max() Parameters type Description liste list A list of list to treat Returns Examples 3.3. Sequence recognition algorithm list A list containing the longest list found >>> l=[1

cmatrix.find_invariant()

Find the invariant part since the beggining until the sequence repetitions start.

op 4.18 cmatrix.Matrix.mand

  A data splitter to treat a large amount of data. Must be improved to treat efficiently a large amount of data.ReturnsMatrix The matrix obtained from a big and between self matrix and given matrix argument

	3.3.9 cmatrix.split_data cmatrix.split_data() cmatrix.Matrix.resize 4.8 cmatrix.Matrix.same_size Table 1 -continued from previous page 4.15 cmatrix.Matrix.op Resize the self matrix from given float ratio. cmatrix.Matrix.accumulate Sum accumulator function ruled by mode argument. CHAPTER FOUR cmatrix.Matrix.square Matrix.same_size() Matrix.op() Test the square propriety of the matrix. cmatrix.Matrix.transpose Transpose the self Matrix. Assertion : same size Standard operators factorization
	Parameters cmatrix.Matrix.permut Eventually complete the description with details as : type	Description Do the permutation of the self matrix with the given
	data size_r cmatrix.Matrix.triangle 4.9 cmatrix.Matrix.mult_compatible list int signed permutation. The given operator as a string is interpreted and the corresponding computing is returned The raw data as list The size_row arguments (considering data as a Matrix) Get the triangle (respectively up or down) of the self MATRIX matrix cmatrix.Matrix.strassen Compute the multiply using the Strassen algorithm to get faster multiplication(not necessary on small matrix). cmatrix.Matrix.tensorial_product Parameters Type Description Matrix.mult_compatible() mat2 Matrix The matrix second term Assertion : multiplication compatibility op String Compute the tensorial product between self Matrix and the operation to realize between : the mat argument. Returns list of list The splitted data into equal size parts 3.3.10 cmatrix.split_number cmatrix.split_number() Split a number by heigth in decimal base. Returns Here the main matrix class engine definition. cmatrix.Matrix.ij_2_ind Convert (i,j) values to raw ribbon index. cmatrix.Matrix.ind_2_ij Convert ribbon index to (i,j) values. cmatrix.Matrix.size_r Getters : size of rows cmatrix.Matrix.size_c Getters : size of columns cmatrix.Matrix.get_ij Getters : get the (i,j) value cmatrix.Matrix.set_ij Setters : set the (i,j) value cmatrix.Matrix.get_ind Getters : get the index value from raw data vector cmatrix.Matrix.trace Trace the current matrix cmatrix.Matrix.convolve 4.10 cmatrix.Matrix.Print • -: add Convolve filtering data matrix using the given mask. cmatrix.Matrix.convolve_signal • -: sub Convolve self object (as a 1D signal) with given convo-Matrix.Print() • -: multiply lution mask (also as 1D signal) cmatrix.Matrix.AtoB Screen Printer • & : logic and Compute the meaned matrix between self and given • : logic or mat. cmatrix.Matrix.gap • ~: logic nand Compute the absolute gap between self matrix and given mat. cmatrix.Matrix.map Map a function (as parameter) to each element of the • ¤ : logic nor 4.11 cmatrix.Matrix.clone • ¨: logic xor
	cmatrix.Matrix.same_size Matrix.clone() list The splitted number as a list cmatrix.Matrix.mult_compatible cmatrix.Matrix.Print cmatrix.Matrix.normalize cmatrix.Matrix.UX_B Object Cloner. See also:		Assertion : same size self matrix Assertion : multiplication compatibility Screen Printer Normalize the self matrix. Compute the UX=B system wher U is an upper matrix
	cmatrix.Matrix.clone Examples cmatrix.Matrix.xtract_sub_matrix cmatrix.Matrix.LX_B size_r() 4.12 cmatrix.Matrix.xtract_sub_matrix Object Cloner. and B the result matrix. Extract the [from_ij] [to_ij] matrix in the self object (if exists) Compute the LX=B system wher L is a lower matrix and B the result matrix. size_c() >>> num=654321 cmatrix.Matrix.insert_sub_matrix Insert the givven sub-matrix in the self matrix if and cmatrix.Matrix.replace_zeros Utilitary function to replace the null values with 1. >>> base=10 >>> split=split_number(num,base) >>> print(split) only if to_insert is smaller. cmatrix.Matrix.find_sub_matrix Search the sub)matrix in the self matrix. cmatrix.Matrix.LU Matrix.xtract_sub_matrix() same_size() Realize a LU decomposition from the self Matrix. cmatrix.Matrix.det Compute the associated determinant of the self matrix. Extract the [from_ij] [to_ij] matrix in the self object (if exists) get_ij() Matrix.mand()
	[6, 5, 4, 3, 2, 1] cmatrix.Matrix.op cmatrix.Matrix.sqrt cmatrix.Matrix.orthogonal cmatrix.Matrix.symmetric Parameters Type set_ij() Realize a big and between self matrix and mat	Standard operators factorization Compute the self sqrt matrix Not Fixed : Do Not Use Boolean test to verify orthogonality Boolean test to verify symmetricity Description
	cmatrix.Matrix.converter cmatrix.Matrix.mand cmatrix.Matrix.hermitian cmatrix.Matrix.reversal cmatrix.Matrix.count_zero from_ij to_ij mult_compatible() Parameters type int tuple tuple containing top left up i,j corner Convert the self matrix values into a string base con-verted values. Realize a big and between self matrix and mat Boolean test to verify if the matrix is hermitian Boolean test to verify the reversability Count the number of zeros in the self Matrix Description int tuple tuple containing top right down i,j corner transpose() mat Matrix* the matrix operand
	cmatrix.Matrix.mor cmatrix.Matrix.nilpotent Returns		Realize a big or between self matrix and mat Boolean test to verify the nilpotence.
	cmatrix.Matrix.mnand cmatrix.Matrix.mnor cmatrix.Matrix.diagonal cmatrix.Matrix.triangular Matrix The extracted sub matrix Examples		Realize a big nand between self matrix and mat Realize a big nor between self matrix and mat Test if the matrix have a diagonal profile. Test if the matrix have a triangulare profile.
	cmatrix.Matrix.mxor cmatrix.Matrix.column cmatrix.Matrix.read_from_file cmatrix.Matrix.write_in_file >>> # Decimal Operator Factorisation See also: >>> t=gaussian(5,1,0)	Realize a big xor between self matrix and mat Xtract the ind column of the self Matrix object. Read and convert a matrix from extern file. Write the current object to file (re-openable in any other
	] | +1.000 | +2.000 | +4.000 | +2.000 | +1.000 | cmatrix.Matrix.line Extract the ind line of the self Matrix object. cmatrix.Matrix.swap_col Swap the two given columns of the self matrix object Matrix object instance) cmatrix.Matrix.pack >>> Print(t) # initializing set_ij() Pack the current matrix to 64bit regular float.
	>>> find_seq_in_list(seq,l) get_ij() | +2.000 | +4.000 | +8.000 | +4.000 | +2.000 | from the given a and b index
	True cmatrix.Matrix.swap_line | +4.000 | +8.000 | +16.000 | +8.000 | +4.000 | Swap the two given lines of the self matrix object from
	>>> seq=[9,8,7] >>> l=[1,2,3,4,5,6,7] >>> find_seq_in_list(seq,l) False | +2.000 | +4.000 | +8.000 | +4.000 | +2.000 | the given a and b index cmatrix.Matrix.mirror_mat | +1.000 | +2.000 | +4.000 | +2.000 | +1.000 | Create the mirror matrix from the self matrix object printed from the given mode argument cmatrix.Matrix.nth_diagonal >>> u=unit(5) * 100 Get the nth diagonal from the current matrix and given >>> Print(u) # initializing
	n as a list. | +100.000 | +0.000 | +0.000 | +0.000 | +0.000 |
	cmatrix.Matrix.get_coef | +0.000 | +100.000 | +0.000 | +0.000 | +0.000 | Return the coefficient to mean a filter mask
	cmatrix.Matrix.mul_coef | +0.000 | +0.000 | +100.000 | +0.000 | +0.000 |
			continues on next page
	32 34 36		Chapter 3. API Functions Chapter 4. Matrix Chapter 4. Matrix

(continues on next page) 4.15. cmatrix.Matrix.

  (cmatrix.Matrix method), 51 reversal() (cmatrix.Matrix method), 71 reverse() (in module cmatrix), 25 S same_size() (cmatrix.Matrix method), 36 set_ij() (cmatrix.Matrix method), 35 size_c() (cmatrix.Matrix method), 35 size_r() (cmatrix.Matrix method), 35 split_data() (in module cmatrix), 32 split_number() (in module cmatrix), 32 sqrt() (cmatrix.Matrix method), 41 square() (cmatrix.Matrix method), 53 strassen() (cmatrix.Matrix method), 56 swap() (in module cmatrix), 25 swap_col() (cmatrix.Matrix method), 47 swap_line() (cmatrix.Matrix method), 48 switch() (in module cmatrix), 26 symmetric() (cmatrix.Matrix method), 69

4.24. cmatrix.Matrix.line resize() T tensorial_product() (cmatrix.Matrix method), 57 timeit() (in module cmatrix), 26 trace() (cmatrix.Matrix method), 59 transpose() (cmatrix.Matrix method), 54 tri() (in module cmatrix), 27 triangle() (cmatrix.Matrix method), 56 triangular() (cmatrix.Matrix method), 73 U unit() (in module cmatrix), 21 UX_B() (cmatrix.Matrix method), 65 W write_in_file() (cmatrix.Matrix method), 75 X xtract_sub_matrix() (cmatrix.Matrix method), 36 Z zeros() (in module cmatrix), 21 80 Index

3.1. Matrix generators

3.2. Utilitary

3.3. Sequence recognition algorithm

Chapter 4. Matrix

4.27. cmatrix.Matrix.mirror_mat

Chapter 5. Indices and tables

Examples

>>> mat=gaussian(5,0,1) >>> xtract=mat.xtract_sub_matrix ([1,1], [4,4]

>>> sum=0

>>> for i in range(0,5): ... for j in range(0,5): ...

sum+=t [[i,j]] ... >>> Print(sum) 1.0 4.46 cmatrix.Matrix.UX_B

Matrix.UX_B()

Compute the UX=B system wher U is an upper matrix and B the result matrix. The system is solved by gauss.

Parameters type Description U

Matrix The upper matrix of the system B Matrix The result matrix of the system

Returns

Matrix 1D Matrix representing the solution of the Upper X system See also: