-
Notifications
You must be signed in to change notification settings - Fork 1
Basics
This code generates random data using Math random. It uses a three-dimensional loop to add together a three-dimensional set.
//Random dimensional values.
var r1 = Math.random() * 10, r2 = Math.random() * 10, r3 = Math.random() * 10;
//Calculate some random dimensional data.
function Dimensional_data( x )
{
//The output.
var out = 0;
//First dimension.
for( var i1 = 0; i1 < x; i1++ )
{
//Can add or subtract value it does not matter.
out += r1;
//Second dimension iterates proportionally to the first dimension.
//Note it does not matter what we iterate till it can even be 7 times the first dimension.
for( var i2 = 0; i2 < i1; i2++ )
{
//Angie does not matter what operation this is.
//Note We can even add together the number of the current first dimension times PI.
//All that does is build another dimension through adding making the third dimension the fourth dimension.
out += r2;
//The third dimension.
for( var i3 = 0; i3 < i2; i3++ )
{
//why not make the third dimension subtract.
out -= r3;
}
}
}
return( out );
}
//Double64 number Epsilon Error correction.
AI_Mat.ErrCorrect = true;
//Create random dimensional data.
for( var i = 0, d = []; i < 7; d[ i ] = Dimensional_data( ( i++ ) + 1 ) );
//Create a new set using the AI matrix Set type.
var s = new set( d );
//Display set of data.
alert( s + "" );
/*---------------------------------------------------------
My random three-dimensional data is as follows.
-----------------------------------------------------------
X0 = 5.55582670474409
X1 = 11.25513255148574
X2 = 10.20096199304021
X3 = -4.50364051777721
X4 = -39.7556305281513
X5 = -102.4519635852667
X6 = -199.4895952363082
---------------------------------------------------------*/
//Sequence each dimension.
var d = s.seq();
//Compile to a function.
var My_func = d.getFunc();
//Display the function.
alert( My_func );
/*---------------------------------------------------------
My function that calculates and produces the same data is.
-----------------------------------------------------------
function( x )
{
var o = 911/1639+5;
o += x * ( 9728 / 12519 + 6 );
o += x ** 2 * 10265 / 143087;
o -= x ** 3 * ( 7940 / 53113 + 1 );
return( o );
}
---------------------------------------------------------*/Also, the Matrix can be used to improve the performance of functions that use loops to calculate results into simple calculations. The calculation abilities of this matrix go far beyond the third dimension. Thus can solve very complex problems. For more information on what types of things this applies to, see section Solve as seq.
Not only can stuff be dimensional inside each other per sums. We also have expanding horizontal dimensions.
The matrix uses the decode matrix as the sequence matrix, then the sequence matrix to decode. In reverse.
//Random dimensional values.
var r1 = Math.random() * 10, r2 = Math.random() * 10, r3 = Math.random() * 10;
//Calculate some random dimensional data.
function Dimensional_data( x )
{
//First horizontal dimension.
//Random dimensional value, plus random dimensional value.
var d1 = r1;
for( var i1 = 0; i1 < x; i1++ )
{
d1 += d1;
}
//Second horizontal dimension.
//Random dimensional value, plus random value, plus random value.
var d2 = r2;
for( var i1 = 0; i1 < x; i1++ )
{
d2 += d2 + d2;
}
//Third horizontal dimension.
//Random dimensional value, plus random value, plus random value, plus random value.
var d3 = r3;
for( var i1 = 0; i1 < x; i1++ )
{
d3 += d3 + d3 + d3;
}
//Mix dimensions.
return( d1 + d3 + d2 );
}
//Double64 number Epsilon Error correction.
AI_Mat.ErrCorrect = true;
//Create random dimensional data.
for( var i = 0, d = []; i < 7; d[i] = Dimensional_data( ( i++ ) + 1 ) );
//Create a new set using the AI matrix Set type.
var s = new set( d );
//Display set of data.
alert( s + "" );
/*---------------------------------------------------------
My random dimensional data is as follows.
-----------------------------------------------------------
X0 = 59.1382464275191
X1 = 210.6470138800445
X2 = 770.992716524155
X3 = 2881.43000209669
X4 = 10942.58772236329
X5 = 42069.9346433353
X6 = 163276.4510588926
---------------------------------------------------------*/
//Sequence each dimension.
var d = s.geo();
//Compile to a function.
var My_func = d.getFunc();
//Display the function.
alert( My_func );
/*---------------------------------------------------------
My function that calculates and produces the same data is.
-----------------------------------------------------------
function( x )
{
var o = 2 ** x * ( 4078 / 7685 + 1 );
o += 3 ** x * ( 1117 / 1879 + 6 );
o += 4 ** x * ( 179 / 2439 + 9 );
return( o );
}
---------------------------------------------------------*/For more information on what types of things this applies to see section Solve as geo.
There are four methods for loading data. For fractional base number conversion, the FL64 library needs to be loaded.
//Method one. Creating a set
var s = new set( 10, 20, 30 );
//Method two. Data generated from an algorithm or from file.
var data = [ 10, 20, 30 ];
s = new set( data );
//Method three. Text input data.
//Text can have line breaks and fractional numbers.
var str = "10,20,30";
s = null;
try
{
s = new set( str );
}
catch( e )
{
alert( e ); //The error output is "Improper set format" if there are values other than numbers.
}
//Numbers do not have to be in decimal if FL64 library is loaded for fraction base conversion.
//If FL64 is not loaded on the same page, "Improper set format" will be returned.
str = "1010.1,1011.01,1100.11";
s = null;
try
{
s = new set( str, 2 ); //Base 2 fractional numbers.
}
catch( e )
{
alert( e ); //The error output is "Improper set format" if FL64 is not loaded or there are values other than base 2 numbers.
}When displaying a set of data, the array index and value is shown in any message output function.
//Create a basic set.
var s = new set( 10, 20, 30 );
//Display the set.
alert( s );
/*---------------------------------------------------------
Output.
-----------------------------------------------------------
X0 = 10
X1 = 20
X2 = 30
---------------------------------------------------------*/Sets are the same as arrays in javascript.
//Create a basic set.
var s = new set( 10, 20, 30 );
//Display the set array length.
alert( s.length ); //outputs 3.
//Add array element one to element two.
s[ 0 ] += s[ 1 ];
//Iterate through the array and add by iterated value.
for( var i = 0; i < s.length; i++ ) { s[ i ] += i; }
//Display output.
alert( s );
/*---------------------------------------------------------
The output is as follows.
-----------------------------------------------------------
X0 = 30
X1 = 21
X2 = 32
---------------------------------------------------------*/Sets also support Array methods: reverse(), splice(), shift(), unshift(), push(), pop().
If FL64 is loaded, all float number binary operations and error correction and fraction conversion functions are then applied to the array. This allows Sets to use all FL64 operations.
FL64 library Main page and Reference.
FL64 library Set/Array implementation.
//Create a basic set.
var s = new set( 10, 20.5, 30.2 );
//Convert all numbers in set to their exact binary representation in the computer's memory.
s = s.bits();
//Display output.
alert( s );
/*---------------------------------------------------------
The output is as follows.
-----------------------------------------------------------
X0 = 0100000000100100000000000000000000000000000000000000000000000000
X1 = 0100000000110100100000000000000000000000000000000000000000000000
X2 = 0100000000111110001100110011001100110011001100110011001100110011
---------------------------------------------------------*/
//Manipulate mantissa bits in element one.
s[ 0 ].mantissa += Math.pow(2,32);
//Add value by one.
s[ 0 ] += 1;
//Display output.
alert( s );
/*---------------------------------------------------------
The output is as follows.
-----------------------------------------------------------
X0 = 11.00000762939453
X1 = 0100000000110100100000000000000000000000000000000000000000000000
X2 = 0100000000111110001100110011001100110011001100110011001100110011
---------------------------------------------------------*/
//Convert the second value to a fraction.
s[ 1 ] = s[ 1 ].getFract();
//Display output.
alert( s );
/*---------------------------------------------------------
The output is as follows.
-----------------------------------------------------------
X0 = 11.00000762939453
X1 = 1÷2+20
X2 = 0100000000111110001100110011001100110011001100110011001100110011
---------------------------------------------------------*/
//Convert all values in the set to fractions.
s = s.getFract();
//Display output.
alert( s );
/*---------------------------------------------------------
The output is as follows.
-----------------------------------------------------------
X0 = 1÷131072+11
X1 = 1÷2+20
X2 = 1÷5+30
---------------------------------------------------------*/
//Xor all 64 bit's of double precision numbers by element one.
s = s.bitXor( s[ 0 ] + 0 );
//Display output.
alert( s );
/*---------------------------------------------------------
The output is as follows.
-----------------------------------------------------------
X0 = 0000000000000000000000000000000000000000000000000000000000000000
X1 = 0000000000010010100000000000000100000000000000000000000000000000
X2 = 0000000000011000001100110011001000110011001100110011001100110011
---------------------------------------------------------*/
//Show as numbers.
s = s.valueOf();
//Display output.
alert( s );
/*---------------------------------------------------------
The output is as follows.
-----------------------------------------------------------
X0 = 0
X1 = 2.57274377089474e-308
X2 = 3.36542208899635e-308
---------------------------------------------------------*/The main sequence method is gensp(). However the full quantum matrix does not need to be used for sequencing a kind of multi-dimensional set.
| Type | Stationary. | Rotation. |
| Sequential(top half). | seq(); | seqsp(); |
| Geometric(bottom half). | geo(); | geosp(); |
| Complete. | gen(); | gensp(); |
At the center of the matrix is a spiral that creates both the sequential half and the geometric half in opposite directions of rotation.
If you are interested in the forum and shape of the matrix and how it works see document Matrix structure: Link.
var s = new set( 0, -899.857142857143, -13167.42857142857, -49732.7142857143,
-52989.7142857143, 290003.571428571, 1898645.142857143, 6871669, 19337225.14285714,
46635599.5714286 );
/*---------------------------------------------------------
Error correction is set to false by default.
---------------------------------------------------------*/
AI_Mat.ErrCorrect = true;
/*---------------------------------------------------------
Seq, and Geo Sequence Data.
---------------------------------------------------------*/
var Data = s.gen();
/*---------------------------------------------------------
Displaying the data results in an ASCII math string of the sequence data.
---------------------------------------------------------*/
alert( Data );
/*---------------------------------------------------------
Output.
-----------------------------------------------------------
X^2*797017/5579118-X^4*911+X^7*11
---------------------------------------------------------*/
/*---------------------------------------------------------
You can make a function of the Data or use an array of functions. Depending on what you are building.
---------------------------------------------------------*/
var My_func1 = Data.getFunc();
/*---------------------------------------------------------
You can display the function as a string and pass values to it.
---------------------------------------------------------*/
alert( "My function\r\n" + My_func1 + "\r\nPass value 9 = " + My_func1( 9 ) + "" );
//The data contains a set called "seq" containing the value of each dimensional sequence.
alert( Data.seq );
/*---------------------------------------------------------
Output.
-----------------------------------------------------------
X0 = 0
X1 = 0
X2 = 797017÷5579118
X3 = 0
X4 = -911
X5 = 0
X6 = 0
X7 = 11
X8 = 0
X9 = 0
---------------------------------------------------------*/
//The data contains a set called "geo" containing the value of each expanding dimensional sequence.
alert( Data.geo );
/*---------------------------------------------------------
Output.
-----------------------------------------------------------
X0 = 0
X1 = 0
X2 = 0
X3 = 0
X4 = 0
X5 = 0
X6 = 0
X7 = 0
X8 = 0
X9 = 0
---------------------------------------------------------*/
//The sets can also be solved again, resulting in a function that produces the dimensions for the sequence.
var Data2 = Data.seq.gen();
var Data3 = Data.geo.gen();
alert( Data2 );
alert( Data3 );
//You can branch it out as many times as you like. You can fractal data if you like.
//Do not forget the sets in data also support all FL64 operations.Also, see other examples like Solve as Seq, or Geo at the beginning.
Solves a set of numbers as Sums to the next number as Summation inside Summation as each pow is another dimension added up by the last dimension geometrically any number of times.
To the programmer, this means Basically a loop adding up values or a loop inside a loop adding up increment values from any number of loops inside one another. It allows the breakdown combinations of any mix of Circles, curves, gravity, quadratics, polynomials, and even wave function combinations.
Solve things that multiply by two per value, or by three, or both sets are existent in the data. Formation of cells and expanded growth, or crystal formation. Base number conversion. Binary digits are in multiples of twos, and Decimal is in multiples of ten per value. Positional Number patterns.
Solves data as both set types.
Any set of data solved as powers will only solve properly if it is plus one number higher than the number of summations inside one another or the largest power in a given set. Basically, X to the power of 7 will only solve properly as 8 numbers as there are 7 summable multiplies. The set can be a combination of any powers lower than 7 multiplied or divided by any size, and you will only need 8 numbers to solve to the last multiply in the set. You can go higher than 8 numbers, but all that will happen is that the numbers in the set higher up will cancel out when the last sum to the last multiple is calculated.
The same concept as Powers, except we are going "number" to the power of X. The largest number to the power of X will be plus one to the number of results needed. You can go higher than that, but all that will happen is that the numbers in the set higher up will cancel out till 0 when the last multiple to the last sum is calculated in reverse.
This solves both backwards and forwards in the set. Thus links the result to an intercepting central matrix of both matrices. The Highest sequence dimension plus the Highest Geo dimension in the set plus one is the required number of results to solve the set properly. You can go higher than the required set of numbers and still solve the set as the rest of the numbers to the center of the set cancel out to 0.
Same as seq, but includes the double spiral rotation on both halves of the matrix. Requires an additional 2 numbers in the set as the start and end values are aligned in the spiral.
Same as geo, but includes the double spiral rotation on both halves of the matrix. Requires an additional 2 numbers in the set as the start and end values are aligned in the spiral.
Same as gen, but includes the double spiral rotation on both halves of the matrix. Requires an additional 2 numbers in the set as the start and end values are aligned in the spiral.
Computers can not do perfect float arithmetic. Thus, we end up with data that should be 0 in alignment but are at the value of EPSILON.
As of version 6, this has been fixed. Thus Float values are also epsilon corrected if the FL64 library is loaded on the same page as the AI matrix. The values are converted to fractions with a dynamic constraint to stop at the error range.
The AI matrix debug script is the same as the regular script.
However, the matrix has an AI_Mat.debug value that is written to after every operation.
To Display the Debug output simply call AI_Mat.toString().
Another method is to just add AI_Mat to string as var out = AI_Mat + "";.
The non-debug version of the AI matrix will give back no debug data, but you can also call the same AI_Mat.toString() function between both without error for compatibility.
The debug data is in HTML format, so you will want to write it to the innerHTML of a DIV element or use document.write.
Note that as soon as the debug data is added to a string or toString is used, the debug data resets.