diff options
633 files changed, 16998 insertions, 7746 deletions
diff --git a/Visual-Studio-settings/f2c.xml b/Visual-Studio-settings/f2c.xml deleted file mode 100644 index b4df883..0000000 --- a/Visual-Studio-settings/f2c.xml +++ /dev/null @@ -1,127 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<ProjectSchemaDefinitions xmlns="clr-namespace:Microsoft.Build.Framework.XamlTypes;assembly=Microsoft.Build.Framework" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:transformCallback="Microsoft.Cpp.Dev10.ConvertPropertyCallback">
- <Rule
- Name="f2c_rule"
- PageTemplate="tool"
- DisplayName="f2c rule"
- Order="200">
- <Rule.DataSource>
- <DataSource
- Persistence="ProjectFile"
- ItemType="f2c_rule" />
- </Rule.DataSource>
- <Rule.Categories>
- <Category
- Name="General">
- <Category.DisplayName>
- <sys:String>General</sys:String>
- </Category.DisplayName>
- </Category>
- <Category
- Name="Command Line"
- Subtype="CommandLine">
- <Category.DisplayName>
- <sys:String>Command Line</sys:String>
- </Category.DisplayName>
- </Category>
- </Rule.Categories>
- <StringListProperty
- Name="Inputs"
- Category="Command Line"
- IsRequired="true"
- Switch=" ">
- <StringListProperty.DataSource>
- <DataSource
- Persistence="ProjectFile"
- ItemType="f2c_rule"
- SourceType="Item" />
- </StringListProperty.DataSource>
- </StringListProperty>
- <StringProperty
- Name="CommandLineTemplate"
- DisplayName="Command Line"
- Visible="False"
- IncludeInCommandLine="False" />
- <DynamicEnumProperty
- Name="f2c_ruleBeforeTargets"
- Category="General"
- EnumProvider="Targets"
- IncludeInCommandLine="False">
- <DynamicEnumProperty.DisplayName>
- <sys:String>Execute Before</sys:String>
- </DynamicEnumProperty.DisplayName>
- <DynamicEnumProperty.Description>
- <sys:String>Specifies the targets for the build customization to run before.</sys:String>
- </DynamicEnumProperty.Description>
- <DynamicEnumProperty.ProviderSettings>
- <NameValuePair
- Name="Exclude"
- Value="^f2c_ruleBeforeTargets|^Compute" />
- </DynamicEnumProperty.ProviderSettings>
- <DynamicEnumProperty.DataSource>
- <DataSource
- Persistence="ProjectFile"
- HasConfigurationCondition="true" />
- </DynamicEnumProperty.DataSource>
- </DynamicEnumProperty>
- <DynamicEnumProperty
- Name="f2c_ruleAfterTargets"
- Category="General"
- EnumProvider="Targets"
- IncludeInCommandLine="False">
- <DynamicEnumProperty.DisplayName>
- <sys:String>Execute After</sys:String>
- </DynamicEnumProperty.DisplayName>
- <DynamicEnumProperty.Description>
- <sys:String>Specifies the targets for the build customization to run after.</sys:String>
- </DynamicEnumProperty.Description>
- <DynamicEnumProperty.ProviderSettings>
- <NameValuePair
- Name="Exclude"
- Value="^f2c_ruleAfterTargets|^Compute" />
- </DynamicEnumProperty.ProviderSettings>
- <DynamicEnumProperty.DataSource>
- <DataSource
- Persistence="ProjectFile"
- ItemType=""
- HasConfigurationCondition="true" />
- </DynamicEnumProperty.DataSource>
- </DynamicEnumProperty>
- <StringListProperty
- Name="Outputs"
- DisplayName="Outputs"
- Visible="False"
- IncludeInCommandLine="False" />
- <StringProperty
- Name="ExecutionDescription"
- DisplayName="Execution Description"
- Visible="False"
- IncludeInCommandLine="False" />
- <StringListProperty
- Name="AdditionalDependencies"
- DisplayName="Additional Dependencies"
- IncludeInCommandLine="False"
- Visible="true" />
- <StringProperty
- Subtype="AdditionalOptions"
- Name="AdditionalOptions"
- Category="Command Line">
- <StringProperty.DisplayName>
- <sys:String>Additional Options</sys:String>
- </StringProperty.DisplayName>
- <StringProperty.Description>
- <sys:String>Additional Options</sys:String>
- </StringProperty.Description>
- </StringProperty>
- </Rule>
- <ItemType
- Name="f2c_rule"
- DisplayName="f2c rule" />
- <FileExtension
- Name="*.f"
- ContentType="f2c_rule" />
- <ContentType
- Name="f2c_rule"
- DisplayName="f2c rule"
- ItemType="f2c_rule" />
-</ProjectSchemaDefinitions>
\ No newline at end of file diff --git a/demos/Abhinav_Demos/Column.sci b/demos/Abhinav_Demos/Column.sci new file mode 100644 index 0000000..b9dc55b --- /dev/null +++ b/demos/Abhinav_Demos/Column.sci @@ -0,0 +1,26 @@ +// Test file for "Column" function for the data types double, float, double complex, string , uint16. +// All the below statements are added to initialize variables in different data types +//The function written doesn't work for string or character scalar as of now. + + +function Column() + a=[1,2,3,4; 5,6,7,8; 98,162,6587,0] + disp( iscolumn(a)) + disp('') + b= float(a) + disp(iscolumn(b)) + c= [1,2,34,5] + d= uint16(c) + disp(iscolumn(d)) + disp('') + f= [1;2;3;4] + disp(iscolumn(f)) + disp('') + u= uint16(c) + disp(iscolumn(u)) + disp('') + g= [%i] + disp(iscolumn(g)) + disp('') + +endfunction diff --git a/demos/Abhinav_Demos/Row.sci b/demos/Abhinav_Demos/Row.sci new file mode 100644 index 0000000..264b174 --- /dev/null +++ b/demos/Abhinav_Demos/Row.sci @@ -0,0 +1,25 @@ +// Test file for "Column" function for the data types double, float, double complex, string , uint16. +// All the below statements are added to initialize variables in different data types +//The function written doesn't work for string or character scalar as of now. + + +function Row() + a=[1,2,3,4; 5,6,7,8; 98,162,6587,0] + disp( isrow(a)) + disp('') + b= float(a) + disp(isrow(b)) + c= [1,2,34,5] + d= uint16(c) + disp(isrow(d)) + disp('') + f= [1;2;3;4] + disp(isrow(f)) + disp('') + u= uint16(c) + disp(isrow(u)) + disp('') + g= [%i*1; 7] + disp(isrow(g)) + disp('') +endfunction diff --git a/demos/Abhinav_Demos/deviation.sci b/demos/Abhinav_Demos/deviation.sci new file mode 100644 index 0000000..99eb5b1 --- /dev/null +++ b/demos/Abhinav_Demos/deviation.sci @@ -0,0 +1,41 @@ +function deviation() + +a=[ 211.128 2912 4.12 123 ; 53211 12.312 21 0] +disp('Double') + +disp(mad(a, 'r')) +disp('') + +disp(mad(a, 'c')) +disp('') + +disp(mad(a)) +disp('') + +disp('Float') + +b= float(a) +disp(mad(b, 'r')) +disp('') + +disp(mad(b, 'c')) +disp('') + +disp(mad(b)) +disp('') + + +disp('DoubleComplex') + +c= [%i*971+ 231, 87+%i*16, 2400+%i*1721; 981,0, %i*1213] +disp(mad(c, 'r')) +disp('') + +disp(mad(c, 'c')) +disp('') + +disp(mad(c)) +disp('') + +endfunction + diff --git a/demos/Abhinav_Demos/is_matrix.sci b/demos/Abhinav_Demos/is_matrix.sci new file mode 100644 index 0000000..540189e --- /dev/null +++ b/demos/Abhinav_Demos/is_matrix.sci @@ -0,0 +1,41 @@ + +// Test file for "ismatrix" function for the data types double, float, double complex, uint16, string + +function is_matrix() + disp('Double') + a= [1 ,25, 52] + disp(ismatrix(a)) + disp('') + b=1.2131 + disp(ismatrix(b)) + disp('') + + disp('Float') + c=float(a) + disp(ismatrix(c)) + disp('') + d=float(b) + disp(ismatrix(d)) + disp('') + + disp('String') + e= ['af' 'as' '12'; '121' 'king' 'queen' ] + disp(ismatrix(e)) + disp('') + f='Light' + disp(ismatrix(f)) + disp('') + + disp('doubleComplex') + g=[%i*2; %i*91+100] + disp(ismatrix(g)) + disp('') + h= %i*98.12 + 121 + disp(ismatrix(h)) + disp('') + + disp('Uint16') + i= [12, 231 ,213, 123] + disp(ismatrix(i)) + disp('') +endfunction diff --git a/demos/Abhinav_Demos/matrixreshape.sci b/demos/Abhinav_Demos/matrixreshape.sci new file mode 100644 index 0000000..38fa0a5 --- /dev/null +++ b/demos/Abhinav_Demos/matrixreshape.sci @@ -0,0 +1,18 @@ + +// Test file for "matrix" function for the data types double, float, double complex, uint16 + +function matrixreshape() + a=[1,2,3,4;5,6,7,8;8,9,1,2] + b=float(a) + c= uint16(b) + d=[%i*2,3,4,5;%i+34,45,32,23; 1,%i*54,8690,1] + +double1= matrix(a,4,3) +float1= matrix (b,4,3) +uint161= matrix(c,4,3) +complex1= matrix(d,4,3) +disp( double1) +disp( float1) +disp( uint161) +disp( complex1) +endfunction diff --git a/demos/Abhinav_Demos/med.sci b/demos/Abhinav_Demos/med.sci new file mode 100644 index 0000000..821ca1f --- /dev/null +++ b/demos/Abhinav_Demos/med.sci @@ -0,0 +1,66 @@ +function med() + +a=float([12,287,312,52; 4,5,456,512; 12, 4, 6,213]) + + +disp('Float') + + +disp(median(a, 'r')) +disp('') + +disp(median(a, 'c')) +disp('') + +disp(median(a)) +disp('') + + +b=[12,287,312,52; 4,5,456,512; 12, 4, 6,213] + + +disp('Double') + + +disp(median(b, 'r')) +disp('') + +disp(median(b, 'c')) +disp('') + +disp(median(b)) +disp('') + + + +disp('uint16') + + +c=uint16([12,287,312,52; 4,5,456,512; 12, 4, 6,213]) +disp(median(c, 'r')) +disp('') + +disp(median(c, 'c')) +disp('') + +disp(median(c)) +disp('') + + +disp('doubleComplex') + + +d= [%i*21, 65+%i*7, %i*121, 56; %i*6112, 12 ,3, 0] +disp(median(d, 'r')) +disp('') + +disp(median(d, 'c')) +disp('') + +disp(median(d)) +disp('') + + + +endfunction + diff --git a/demos/Abhinav_Demos/modula.sci b/demos/Abhinav_Demos/modula.sci new file mode 100644 index 0000000..8f56e6c --- /dev/null +++ b/demos/Abhinav_Demos/modula.sci @@ -0,0 +1,57 @@ +function modula() + +a=312 +b=18.12 +disp('Double') + +disp(pmodulo(a,b)) + +disp(pmodulo(a,-b)) + +disp(pmodulo(-a,b)) + +disp(pmodulo(-a,-b)) + +k=[12 , -134 , 1213; -12.12, -0.12, 91281] +l=[12, ,1212 ,12; -91288.12, -0.912, -10000] + +disp(pmodulo(k,l)) + +disp('Float') +c= float(312) +d=float(121.212) + +disp(pmodulo(c,d)) + +disp(pmodulo(c,-d)) + +disp(pmodulo(-c,d)) + +disp(pmodulo(-c,-d)) + +e=float([12 , -134 , 1213; -12.12, -0.12, 91281]) +f=float([12, ,1212 ,12; -91288.12, -0.912, -10000]) + +disp( pmodulo(e,f)) + +disp('Uint16') + +g= int16(112) +h= int16(121) + +disp(pmodulo(g,h)) + +disp(pmodulo(g,-h)) + +disp(pmodulo(-g,h)) + +disp(pmodulo(-g,-h)) + +i= int16([12 , -134 , 1213; -12.12, -12.54, 91281]) + +j= int16([12, ,1212 ,12; 1121, -6000, -10000]) +disp( pmodulo(i,j)) + + +endfunction + diff --git a/demos/Abhinav_Demos/nan_max.sci b/demos/Abhinav_Demos/nan_max.sci new file mode 100644 index 0000000..769a92a --- /dev/null +++ b/demos/Abhinav_Demos/nan_max.sci @@ -0,0 +1,33 @@ +function nan_max() + +x=[%nan 0.121 %nan 0.5 0.8; 0.12 %nan 9 12 %nan] + +disp('Double') + +disp(nanmax(x)) +disp('') + +disp(nanmax(x , 'r')) +disp('') + +disp(nanmax(x, 'c')) +disp('') + +y= uint16(x) + +disp('Float') + +disp(nanmax(y)) +disp('') + +disp(nanmax(y , 'r')) +disp('') + +disp(nanmax(y, 'c')) +disp('') + + + + +endfunction + diff --git a/demos/Abhinav_Demos/nonzero.sci b/demos/Abhinav_Demos/nonzero.sci new file mode 100644 index 0000000..14a1416 --- /dev/null +++ b/demos/Abhinav_Demos/nonzero.sci @@ -0,0 +1,15 @@ + +// Test file for "nonzero" function for the data types double, float, double complex, uint16 + +function nonzero() + a=[12,4,4; 12,51,6] // double array + disp(nnz(a)) + b=0 //double scalar + disp(nnz(b)) + f= float(a) //float array + disp(nnz(f)) + z=%i*2+0 // doubleComplex scalar + disp(nnz(z)) + + +endfunction diff --git a/demos/Abhinav_Demos/nthroot1.sci b/demos/Abhinav_Demos/nthroot1.sci new file mode 100644 index 0000000..201338b --- /dev/null +++ b/demos/Abhinav_Demos/nthroot1.sci @@ -0,0 +1,23 @@ +// Test file for "nthroot" function for the data types double, float, double complex. + + +function nthroot1() + b= [1,2,3,4;5,6,7,8] + c=[45,12,4,12; 23,34,5,6] + d= nthroot(b,c) +disp(d) +disp('') +e=34 +f= nthroot(b,e) +disp(f) +disp('') +k=nthroot(3.2123,12) +disp(k) +disp('') + +m= float(b) +l= float(c) +disp(nthroot(m,l)) + + +endfunction diff --git a/demos/Abhinav_Demos/scalar.sci b/demos/Abhinav_Demos/scalar.sci new file mode 100644 index 0000000..6b280ea --- /dev/null +++ b/demos/Abhinav_Demos/scalar.sci @@ -0,0 +1,12 @@ +// Test file for "isscalar" function for the data types double, float, double complex. +function scalar() + a=[1,2,3,4] + disp(isscalar(a)) + b= float(a) + disp(isscalar(b)) + c= %i*2+34 + disp(isscalar(c)) + + + +endfunction diff --git a/demos/Abhinav_Demos/square.sci b/demos/Abhinav_Demos/square.sci new file mode 100644 index 0000000..172f73c --- /dev/null +++ b/demos/Abhinav_Demos/square.sci @@ -0,0 +1,13 @@ +// Test file for "Column" function for the data types double, float, double complex, string. +// All the below statements are added to initialize variables in different data types + + +function square() + a=[1,2,3,4; 5,6,7,8; 98,162,6587,0] + disp(issquare(a)) + disp('') + b= [%i+25, 1, %i*5+12] + disp(issquare(b)) + disp('') + +endfunction diff --git a/demos/Abhinav_Demos/vector.sci b/demos/Abhinav_Demos/vector.sci new file mode 100644 index 0000000..dedd8f1 --- /dev/null +++ b/demos/Abhinav_Demos/vector.sci @@ -0,0 +1,16 @@ +// Test file for "vector" function for the data types double, float, double complex. +function vector() + a=[1,2,3,4] + disp(isvector(a)) + disp('') + b= %i+2 + disp(isvector(b)) + disp('') + c= float([1,3,4;1,2,3]) + disp(isvector(c)) + disp('') + d= [%i*812; %i*12] + disp(isvector(d)) + disp('') + +endfunction diff --git a/demos/Arduino/Arduino.dem.gateway.sce b/demos/Arduino/Arduino.dem.gateway.sce new file mode 100644 index 0000000..417291a --- /dev/null +++ b/demos/Arduino/Arduino.dem.gateway.sce @@ -0,0 +1,22 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh, Yash Pratap Singh Tomar +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +subdemolist = ["Arduino blink", "blink.dem.sce"; + "Arduino digital input", "digital_in.dem.sce"; + "Arduino analog voltage i/o", "analog_in_out_volt.dem.sce"; + "Arduino analog output", "analog_out.dem.sce"; + "Arduino DC motor", "dc_motor.dem.sce"; + "Arduino Master write", "master_write.dem.sce"; + ]; + +global SCI2CHOME; +subdemolist(:,2) = SCI2CHOME + "/demos/Arduino/"+ subdemolist(:,2); diff --git a/demos/Arduino/analog_in_out_volt.dem.sce b/demos/Arduino/analog_in_out_volt.dem.sce new file mode 100644 index 0000000..ca6da61 --- /dev/null +++ b/demos/Arduino/analog_in_out_volt.dem.sce @@ -0,0 +1,7 @@ +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/testArduino/analog_in_check_volt.sci", TMPDIR, SCI2CHOME+"/tests/unit_tests/testArduino", "All", "make" ,"Arduino", "uno"); + +editor([TMPDIR+"/setup_arduino.cpp";TMPDIR+"/loop_arduino.cpp"]); diff --git a/demos/Arduino/analog_out.dem.sce b/demos/Arduino/analog_out.dem.sce new file mode 100644 index 0000000..65a1e27 --- /dev/null +++ b/demos/Arduino/analog_out.dem.sce @@ -0,0 +1,7 @@ +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/testArduino/analog_check.sci", TMPDIR, SCI2CHOME+"/tests/unit_tests/testArduino", "All", "make" ,"Arduino", "uno"); + +editor([TMPDIR+"/setup_arduino.cpp";TMPDIR+"/loop_arduino.cpp"]); diff --git a/demos/Arduino/blink.dem.sce b/demos/Arduino/blink.dem.sce new file mode 100644 index 0000000..b01d3da --- /dev/null +++ b/demos/Arduino/blink.dem.sce @@ -0,0 +1,7 @@ +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/testArduino/blink_13.sci", TMPDIR, SCI2CHOME+"/tests/unit_tests/testArduino", "All", "make" ,"Arduino", "uno"); + +editor([TMPDIR+"/setup_arduino.cpp";TMPDIR+"/loop_arduino.cpp"]); diff --git a/demos/Arduino/dc_motor.dem.sce b/demos/Arduino/dc_motor.dem.sce new file mode 100644 index 0000000..36c0bad --- /dev/null +++ b/demos/Arduino/dc_motor.dem.sce @@ -0,0 +1,7 @@ +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/testArduino/board_test_release2.sci", TMPDIR, SCI2CHOME+"/tests/unit_tests/testArduino", "All", "make" ,"Arduino", "uno"); + +editor([TMPDIR+"/setup_arduino.cpp";TMPDIR+"/loop_arduino.cpp"]); diff --git a/demos/Arduino/digital_in.dem.sce b/demos/Arduino/digital_in.dem.sce new file mode 100644 index 0000000..2eb4c3a --- /dev/null +++ b/demos/Arduino/digital_in.dem.sce @@ -0,0 +1,7 @@ +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/testArduino/digital_in_check.sci", TMPDIR, SCI2CHOME+"/tests/unit_tests/testArduino", "All", "make" ,"Arduino", "uno"); + +editor([TMPDIR+"/setup_arduino.cpp";TMPDIR+"/loop_arduino.cpp"]); diff --git a/demos/Arduino/master_write.dem.sce b/demos/Arduino/master_write.dem.sce new file mode 100644 index 0000000..cdf522d --- /dev/null +++ b/demos/Arduino/master_write.dem.sce @@ -0,0 +1,7 @@ +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/testArduino/i2c_master.sci", TMPDIR, SCI2CHOME+"/tests/unit_tests/testArduino", "All", "make" ,"Arduino", "uno"); + +editor([TMPDIR+"/setup_arduino.cpp";TMPDIR+"/loop_arduino.cpp"]); diff --git a/demos/Brijesh_Demos/Test_Add_SCE.sce b/demos/Brijesh_Demos/Test_Add_SCE.sce new file mode 100644 index 0000000..e250078 --- /dev/null +++ b/demos/Brijesh_Demos/Test_Add_SCE.sce @@ -0,0 +1,4 @@ +a = 1; +b = 5; +c = a+b; +disp(c); diff --git a/demos/Brijesh_Demos/Test_Addition.sci b/demos/Brijesh_Demos/Test_Addition.sci new file mode 100644 index 0000000..856ba63 --- /dev/null +++ b/demos/Brijesh_Demos/Test_Addition.sci @@ -0,0 +1,8 @@ +function Test_Addition() + a = 1; + b = 2; + d = float(b); + e = float(a) + c = e+d; + disp(c); +endfunction diff --git a/demos/Brijesh_Demos/Test_Cross.sci b/demos/Brijesh_Demos/Test_Cross.sci new file mode 100644 index 0000000..01206b3 --- /dev/null +++ b/demos/Brijesh_Demos/Test_Cross.sci @@ -0,0 +1,44 @@ +function Test_Cross + disp('Datatype: Double'); + i1 = [1 2;3 4;5 6]; + i2 = [7 8;9 10;11 12]; + o1 = cross(i1,i2); + disp(o1); + + disp('Datatype: DoubleComplex'); + i3 = [1+1*%i 2+2*%i;3+3*%i 4+4*%i;5+5*%i 6+6*%i]; + i4 = [7+7*%i 8+8*%i;9+9*%i 10+10*%i;11+11*%i 12+12*%i]; + o2 = cross(i3,i4); + disp(o2); + + disp('Float'); + i5 = float([1 2;3 4;5 6]); + i6 = float([7 8;9 10;11 12]); + o3 = cross(i5,i6); + disp(o3); + + disp('Datatype: uint8'); + i7 = uint8([1 2;3 4;5 6]); + i8 = uint8([7 8;9 10;11 12]); + o4 = cross(i7,i8); + disp(o4); + + disp('Datatype: int8'); + i9 = int8([1 2;3 4;5 6]); + i10 = int8([7 8;9 10;11 12]); + o5 = cross(i9,i10); + disp(o5); + + disp('Datatype: uint16'); + i11 = uint16([1 2;3 4;5 6]); + i12 = uint16([7 8;9 10;11 12]); + o6 = cross(i11,i12); + disp(o6); + + disp('Datatype: int16'); + i13 = int8([1 2;3 4;5 6]); + i14 = int8([7 8;9 10;11 12]); + o7 = cross(i13,i14); + disp(o7); + +endfunction diff --git a/demos/Brijesh_Demos/Test_Erf.sci b/demos/Brijesh_Demos/Test_Erf.sci new file mode 100644 index 0000000..42208f6 --- /dev/null +++ b/demos/Brijesh_Demos/Test_Erf.sci @@ -0,0 +1,10 @@ +function Test_Erf + disp('Datatype: Double'); + i1 = [1 2 .5; 7 .8 .9]; + o1 = erf(i1); + disp(o1); + disp('Datatype: float'); + i2 = float([1 2 .5; 7 .8 .9]); + o2 = erf(i2); + disp(o2); +endfunction diff --git a/demos/Brijesh_Demos/Test_Erfc.sci b/demos/Brijesh_Demos/Test_Erfc.sci new file mode 100644 index 0000000..2ad8cfe --- /dev/null +++ b/demos/Brijesh_Demos/Test_Erfc.sci @@ -0,0 +1,10 @@ +function Test_Erfc + disp('Datatype: Double'); + i1 = [1 2 .5; 7 .8 .9]; + o1 = erfc(i1); + disp(o1); + disp('Datatype: float'); + i2 = float([1 2 .5; 7 .8 .9]); + o2 = erfc(i2); + disp(o2); +endfunction diff --git a/demos/Brijesh_Demos/Test_Erfcx.sci b/demos/Brijesh_Demos/Test_Erfcx.sci new file mode 100644 index 0000000..e17ae51 --- /dev/null +++ b/demos/Brijesh_Demos/Test_Erfcx.sci @@ -0,0 +1,10 @@ +function Test_Erfcx + disp('Datatype: Double'); + i1 = [.75 .8 -.32]; + o1 = erfcx(i1); + disp(o1); + disp('Datatype: float'); + i2 = float([1 2 .5; 7 .8 .9]); + o2 = erfc(i2); + disp(o2); +endfunction diff --git a/demos/Brijesh_Demos/Test_Erfinv.sci b/demos/Brijesh_Demos/Test_Erfinv.sci new file mode 100644 index 0000000..99a8683 --- /dev/null +++ b/demos/Brijesh_Demos/Test_Erfinv.sci @@ -0,0 +1,10 @@ +function Test_Erfinv + disp('Datatype: Double'); + i1 = [12 0.6 -2 -0.75]; + o1 = erfinv(i1); + disp(o1); + disp('Datatype: float'); + i2 = float([5 0.35 -1 -.97 -6]); + o2 = erf(i2); + disp(o2); +endfunction diff --git a/demos/Brijesh_Demos/Test_Isreal.sci b/demos/Brijesh_Demos/Test_Isreal.sci new file mode 100644 index 0000000..4846d31 --- /dev/null +++ b/demos/Brijesh_Demos/Test_Isreal.sci @@ -0,0 +1,25 @@ +function Test_Isreal + disp('Datatype: Double'); + i1 = [1 2 3]; + i2 = [1 2 3]; + o1 = isequal(i1,i2); + disp(o1); + + disp('Datatype: Float'); + i3 = float([4 5 6]); + i4 = float([4 5 6]); + o2 = isequal(i3,i4); + disp(o2); + + disp('Datatype: DoubleComplex'); + i5 = [%i*3 %i*3 %i*3]; + i6 = [%i*3 %i*3 %i*3]; + o3 = isequal(i5,i6); + disp(o3); + + disp('Datatype: uint16'); + i7 = uint16([4 5 6]); + i8 = uint16([4 5 6]); + o4 = isequal(i7,i8); + disp(o4); +endfunction diff --git a/demos/Brijesh_Demos/Test_Toeplitz.sci b/demos/Brijesh_Demos/Test_Toeplitz.sci new file mode 100644 index 0000000..6d1269e --- /dev/null +++ b/demos/Brijesh_Demos/Test_Toeplitz.sci @@ -0,0 +1,50 @@ +function Test_Toeplitz() + disp('Datatype: Double'); + ai = [1 2 3 4]; + bi = [1 6 7 8]; + as1 = toeplitz(ai,bi); + disp(as1); + + disp('Datatype: Float'); + aid = float(ai); + bid = float(bi); + as2 = toeplitz(aid,bid); + disp(as2); + + disp('Datatype: uint8'); + aiu8 = uint8(ai); + biu8 = uint8(bi); + as3 = toeplitz(aiu8,biu8); + disp(as3); + + disp('Datatype: int8'); + ai8 = int8(ai); + bi8 = int8(bi); + as4= toeplitz(ai8,bi8); + disp(as4); + + disp('Datatype: uint16'); + aiu16 = uint16(ai); + biu16 = uint16(bi); + as5 = toeplitz(aiu16,biu16); + disp(as5); + + disp('Datatype: int16'); + ai16 = int16(ai); + bi16 = int16(bi); + as6 = toeplitz(ai16,bi16); + disp(as6); + + disp('Datatype: Double Complex'); + adc = [1+%i*1 2+%i*2 3+%i*3 4+%i*4]; + bdc = [1+%i*1 6+%i*6 7+%i*7 8+%i*8]; + as7 = toeplitz(adc,bdc); + disp(as7); + + disp('Datatype: Char'); + aic = ['a' 'b' 'c' 'd']; + bic = ['a' 'x' 'y' 'z']; + as9 = toeplitz(aic,bic); + disp(as9); + +endfunction diff --git a/demos/CT/CT.dem.gateway.sce b/demos/CT/CT.dem.gateway.sce new file mode 100644 index 0000000..1aba91e --- /dev/null +++ b/demos/CT/CT.dem.gateway.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh, Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +subdemolist = ["Discrete Cosine Transform" , "test_dct.dem.sce"; + "Inverse Cosine Transform" , "test_idct.dem.sce"; + ]; + +global SCI2CHOME; +subdemolist(:,2) = SCI2CHOME + "/demos/CT/"+ subdemolist(:,2); diff --git a/demos/test_dct.dem.sce b/demos/CT/test_dct.dem.sce index b1b6247..b1b6247 100644 --- a/demos/test_dct.dem.sce +++ b/demos/CT/test_dct.dem.sce diff --git a/demos/test_idct.dem.sce b/demos/CT/test_idct.dem.sce index b1d3339..b1d3339 100644 --- a/demos/test_idct.dem.sce +++ b/demos/CT/test_idct.dem.sce diff --git a/demos/Filter.dem.sce b/demos/Filters/Filter.dem.sce index 100b37b..100b37b 100644 --- a/demos/Filter.dem.sce +++ b/demos/Filters/Filter.dem.sce diff --git a/demos/Filters/FilterResponse.dem.sce b/demos/Filters/FilterResponse.dem.sce new file mode 100644 index 0000000..7104836 --- /dev/null +++ b/demos/Filters/FilterResponse.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +//This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Ankit Raj +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/test_filterResponse/scilabcode/main.sci",TMPDIR,SCI2CHOME+"/tests/unit_tests/test_filterResponse/scilabcode"); diff --git a/demos/Filters/Filters.dem.gateway.sce b/demos/Filters/Filters.dem.gateway.sce new file mode 100644 index 0000000..274d0e4 --- /dev/null +++ b/demos/Filters/Filters.dem.gateway.sce @@ -0,0 +1,19 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh, Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +subdemolist = ["High Pass Filter", "Filter.dem.sce"; + "Analog Filters","analogFilter.dem.sce"; + "Filter Responses","FilterResponse.dem.sce"; + ]; + +global SCI2CHOME; +subdemolist(:,2) = SCI2CHOME + "/demos/Filters/"+ subdemolist(:,2); diff --git a/demos/Filters/analogFilter.dem.sce b/demos/Filters/analogFilter.dem.sce new file mode 100644 index 0000000..674c954 --- /dev/null +++ b/demos/Filters/analogFilter.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +//This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Ankit Raj +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/test_analogFilters/scilabcode/main.sci",TMPDIR,SCI2CHOME+"/tests/unit_tests/test_analogFilters/scilabcode"); diff --git a/demos/Jacobi.dem.sce b/demos/Jacobi.dem.sce new file mode 100644 index 0000000..0b1618c --- /dev/null +++ b/demos/Jacobi.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Ankit Raj +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/test_jacobi/scilabcode/main.sci",TMPDIR,SCI2CHOME+"/tests/unit_tests/test_jacobi/scilabcode"); + diff --git a/demos/LinearAlgebra/FULLRF.dem.sce b/demos/LinearAlgebra/FULLRF.dem.sce new file mode 100644 index 0000000..3aeeba2 --- /dev/null +++ b/demos/LinearAlgebra/FULLRF.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testfullrf/testfullrf.sci", TMPDIR,SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testfullrf"); + +editor(TMPDIR+"/main.c"); diff --git a/demos/LinearAlgebra/GIVENS.dem.sce b/demos/LinearAlgebra/GIVENS.dem.sce new file mode 100644 index 0000000..0ab2d2a --- /dev/null +++ b/demos/LinearAlgebra/GIVENS.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testgivens/testgivens.sci", TMPDIR,SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testgivens"); + +editor(TMPDIR+"/main.c"); diff --git a/demos/LinearAlgebra/HESS.dem.sce b/demos/LinearAlgebra/HESS.dem.sce new file mode 100644 index 0000000..4c70d67 --- /dev/null +++ b/demos/LinearAlgebra/HESS.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testhess/testhess.sci", TMPDIR,SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testhess"); + +editor(TMPDIR+"/main.c"); diff --git a/demos/LinearAlgebra/HOUSEHOLDER.dem.sce b/demos/LinearAlgebra/HOUSEHOLDER.dem.sce new file mode 100644 index 0000000..7447407 --- /dev/null +++ b/demos/LinearAlgebra/HOUSEHOLDER.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testhouseholder/testhouseholder.sci", TMPDIR,SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testhouseholder"); + +editor(TMPDIR+"/main.c"); diff --git a/demos/LinearAlgebra/LinearAlgebra.dem.gateway.sce b/demos/LinearAlgebra/LinearAlgebra.dem.gateway.sce new file mode 100644 index 0000000..ef99e53 --- /dev/null +++ b/demos/LinearAlgebra/LinearAlgebra.dem.gateway.sce @@ -0,0 +1,27 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh, Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +subdemolist = ["Singular Value Decomposition", "SVD.dem.sce"; + "Singular Value Approximation", "SVA.dem.sce"; + "SQROOT", "SQROOT.dem.sce"; + "SPEC", "SPEC.dem.sce"; + "ROWCOMP","ROWCOMP.dem.sce"; + "QR Decomposition", "QR.dem.sce"; + "NORM type 2", "NORM.dem.sce"; + "HOUSEHOLDER","HOUSEHOLDER.dem.sce"; + "HESS", "HESS.dem.sce"; + "GIVENS Transformation", "GIVENS.dem.sce"; + "Full rank factorization","FULLRF.dem.sce"; + ]; + +global SCI2CHOME; +subdemolist(:,2) = SCI2CHOME + "/demos/LinearAlgebra/"+ subdemolist(:,2); diff --git a/demos/LinearAlgebra/NORM.dem.sce b/demos/LinearAlgebra/NORM.dem.sce new file mode 100644 index 0000000..1de3feb --- /dev/null +++ b/demos/LinearAlgebra/NORM.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testnorm/testnorm.sci", TMPDIR,SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testnorm"); + +editor(TMPDIR+"/main.c"); diff --git a/demos/LinearAlgebra/QR.dem.sce b/demos/LinearAlgebra/QR.dem.sce new file mode 100644 index 0000000..7d2fc1a --- /dev/null +++ b/demos/LinearAlgebra/QR.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testqr/testQR.sci", TMPDIR,SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testqr"); + +editor(TMPDIR+"/main.c"); diff --git a/demos/LinearAlgebra/ROWCOMP.dem.sce b/demos/LinearAlgebra/ROWCOMP.dem.sce new file mode 100644 index 0000000..6557eb4 --- /dev/null +++ b/demos/LinearAlgebra/ROWCOMP.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testrowcomp/testrcomp.sci", TMPDIR,SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testrowcomp"); + +editor(TMPDIR+"/main.c"); diff --git a/demos/LinearAlgebra/SPEC.dem.sce b/demos/LinearAlgebra/SPEC.dem.sce new file mode 100644 index 0000000..423c152 --- /dev/null +++ b/demos/LinearAlgebra/SPEC.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testspec/testspec.sci", TMPDIR,SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testspec"); + +editor(TMPDIR+"/main.c"); diff --git a/demos/LinearAlgebra/SQROOT.dem.sce b/demos/LinearAlgebra/SQROOT.dem.sce new file mode 100644 index 0000000..676d5e5 --- /dev/null +++ b/demos/LinearAlgebra/SQROOT.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testsqroot/testsqroot.sci", TMPDIR,SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testsqroot"); + +editor(TMPDIR+"/main.c"); diff --git a/demos/LinearAlgebra/SVA.dem.sce b/demos/LinearAlgebra/SVA.dem.sce new file mode 100644 index 0000000..3ced74f5 --- /dev/null +++ b/demos/LinearAlgebra/SVA.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testsva/testsva.sci", TMPDIR,SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/testsva"); + +editor(TMPDIR+"/main.c"); diff --git a/demos/LinearAlgebra/SVD.dem.sce b/demos/LinearAlgebra/SVD.dem.sce new file mode 100644 index 0000000..aa35cce --- /dev/null +++ b/demos/LinearAlgebra/SVD.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/test_svd/testsvd.sci", TMPDIR,SCI2CHOME+"/tests/unit_tests/testLinearAlgebra/test_svd"); + +editor(TMPDIR+"/main.c"); diff --git a/demos/RPi/RPi.dem.gateway.sce b/demos/RPi/RPi.dem.gateway.sce new file mode 100644 index 0000000..c125e9c --- /dev/null +++ b/demos/RPi/RPi.dem.gateway.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh, Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +subdemolist = ["Wait and Blink","test_wait_and_blink.dem.sce"; + "LCD","test_lcd.dem.sce" + ]; + +global SCI2CHOME; +subdemolist(:,2) = SCI2CHOME + "/demos/RPi/"+ subdemolist(:,2); diff --git a/demos/RPi/test_lcd.dem.sce b/demos/RPi/test_lcd.dem.sce new file mode 100644 index 0000000..2bd1951 --- /dev/null +++ b/demos/RPi/test_lcd.dem.sce @@ -0,0 +1,19 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh, Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME + "/tests/unit_tests/test_RPi/lcd.sci", TMPDIR,SCI2CHOME + "/tests/unit_tests/test_RPi/", "All", "make" ,"RPi", "uno"); + +editor([TMPDIR+"/main.c"]); diff --git a/demos/RPi/test_wait_and_blink.dem.sce b/demos/RPi/test_wait_and_blink.dem.sce new file mode 100644 index 0000000..31396c6 --- /dev/null +++ b/demos/RPi/test_wait_and_blink.dem.sce @@ -0,0 +1,19 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh, Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME + "/tests/unit_tests/test_RPi/wait_and_blink.sci", TMPDIR,SCI2CHOME + "/tests/unit_tests/test_RPi/", "All", "make" ,"RPi", "uno"); + +editor([TMPDIR+"/main.c"]); diff --git a/demos/ffilt.dem.sce b/demos/ffilt.dem.sce new file mode 100644 index 0000000..0268041 --- /dev/null +++ b/demos/ffilt.dem.sce @@ -0,0 +1,16 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +//This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Ankit Raj +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/test_ffilt/scilabcode/main.sci",TMPDIR,SCI2CHOME+"/tests/unit_tests/test_ffilt/scilabcode"); diff --git a/demos/filt_sinc.dem.sce b/demos/filt_sinc.dem.sce new file mode 100644 index 0000000..001ceb8 --- /dev/null +++ b/demos/filt_sinc.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +//This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Ankit Raj +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/test_filtsinc/scilabcode/filt_sinctest.sci",TMPDIR,SCI2CHOME+"/tests/unit_tests/test_filtsinc/scilabcode"); diff --git a/demos/fsfirlin.dem.sce b/demos/fsfirlin.dem.sce new file mode 100644 index 0000000..278252a --- /dev/null +++ b/demos/fsfirlin.dem.sce @@ -0,0 +1,16 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +//This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Ankit Raj +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/test_fsfirlin/scilabcode/main.sci",TMPDIR,SCI2CHOME+"/tests/unit_tests/test_fsfirlin/scilabcode"); diff --git a/demos/scilab2c.dem.gateway.sce b/demos/scilab2c.dem.gateway.sce index 3346885..1e2a6c7 100644 --- a/demos/scilab2c.dem.gateway.sce +++ b/demos/scilab2c.dem.gateway.sce @@ -12,12 +12,17 @@ demopath = get_absolute_file_path("scilab2c.dem.gateway.sce"); -subdemolist = ["Trigonometric Identity" , "TrigonometricIdentity.dem.sce"; +subdemolist =["Linear Algebra","LinearAlgebra/LinearAlgebra.dem.gateway.sce"; + "Arduino","Arduino/Arduino.dem.gateway.sce"; + "Cosine Transforms","CT/CT.dem.gateway.sce"; + "Filters","Filters/Filters.dem.gateway.sce"; + "Raspberry Pi","RPi/RPi.dem.gateway.sce"; + "Trigonometric Identity" , "TrigonometricIdentity.dem.sce"; "Linear Regression" , "LinearRegression.dem.sce"; "Symbols", "Symbols.dem.sce"; - "High Pass Filter", "Filter.dem.sce"; - "Discrete Cosine Transform" , "test_dct.dem.sce"; - "Inverse Cosine Transform" , "test_idct.dem.sce"; - ]; - + "Jacobi functions","Jacobi.dem.sce"; + "String Functions","string.dem.sce"; + "Ffilt coeff. of FIR low pass filter","ffilt.dem.sce"; + "Design of FIR linear phase filters using freq. samping technique","fsfirlin.dem.sce"; + "Samples of sinc function","filt_sinc.dem.sce";] subdemolist(:,2) = demopath + subdemolist(:,2); diff --git a/demos/string.dem.sce b/demos/string.dem.sce new file mode 100644 index 0000000..db90905 --- /dev/null +++ b/demos/string.dem.sce @@ -0,0 +1,16 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +//This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Ankit Raj +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/test_string/scilabcode/main.sci",TMPDIR,SCI2CHOME+"/tests/unit_tests/test_string/scilabcode"); diff --git a/etc/scilab2c.start b/etc/scilab2c.start index 793b0a7..330def7 100644 --- a/etc/scilab2c.start +++ b/etc/scilab2c.start @@ -22,6 +22,24 @@ sci2c_ToolInitlib = lib(pathmacros + "ToolInitialization" + filesep()); sci2c_finDeps = lib(pathmacros + "findDeps" + filesep()); sci2c_AVRlib = lib(pathmacros + "Hardware\AVR" + filesep()); sci2c_RPilib = lib(pathmacros + "Hardware\RasberryPi"+ filesep()); +sci2c_RPI_Digitallib = lib(pathmacros + "Hardware\RasberryPi\Digital" + filesep()); +sci2c_RPI_gertBoardlib = lib(pathmacros + "Hardware\RasberryPi\gertBoard" + filesep()); +sci2c_RPI_I2Clib = lib(pathmacros + "Hardware\RasberryPi\I2C" + filesep()); +sci2c_RPI_Interruptlib = lib(pathmacros + "Hardware\RasberryPi\Interrupt" + filesep()); +sci2c_RPI_lcdlib = lib(pathmacros + "Hardware\RasberryPi\lcd" + filesep()); +sci2c_RPI_lcd128x64lib = lib(pathmacros + "Hardware\RasberryPi\lcd128x64" + filesep()); +sci2c_RPI_mcplib = lib(pathmacros + "Hardware\RasberryPi\mcp" + filesep()); +sci2c_RPI_Misclib = lib(pathmacros + "Hardware\RasberryPi\Misc" + filesep()); +sci2c_RPI_pcflib = lib(pathmacros + "Hardware\RasberryPi\pcf" + filesep()); +sci2c_RPI_piGlowlib = lib(pathmacros + "Hardware\RasberryPi\piGlow" + filesep()); +sci2c_RPI_pinMaplib = lib(pathmacros + "Hardware\RasberryPi\pinMap" + filesep()); +sci2c_RPI_pwmlib = lib(pathmacros + "Hardware\RasberryPi\pwm" + filesep()); +sci2c_RPI_Seriallib = lib(pathmacros + "Hardware\RasberryPi\Serial" + filesep()); +sci2c_RPI_Setuplib = lib(pathmacros + "Hardware\RasberryPi\Setup" + filesep()); +sci2c_RPI_Shiftlib = lib(pathmacros + "Hardware\RasberryPi\Shift" + filesep()); +sci2c_RPI_Softlib = lib(pathmacros + "Hardware\RasberryPi\Soft" + filesep()); +sci2c_RPI_SPIlib = lib(pathmacros + "Hardware\RasberryPi\SPI" + filesep()); +sci2c_RPI_Timinglib = lib(pathmacros + "Hardware\RasberryPi\Timing" + filesep()); sci2c_ScilabArduinolib = lib(pathmacros + "Scilab-Arduino" + filesep()); sci2c_CVCorelib = lib(pathmacros + "ImageProcessing\core" + filesep()); sci2c_CVHighguilib = lib(pathmacros + "ImageProcessing\highgui" + filesep()); @@ -44,7 +62,7 @@ end // ============================================================================= if or(getscilabmode() == ["NW";"STD"]) then - mprintf("\tLoad demos\n"); + mprintf("\tLoad demos\n"); pathdemos = pathconvert(root_tlbx + "/demos/scilab2c.dem.gateway.sce",%f,%t); add_demo(gettext("Scilab2C"),pathdemos); diff --git a/help/en_US/AVRADCSetup.xml b/help/en_US/AVRADCSetup.xml deleted file mode 100644 index a0abf03..0000000 --- a/help/en_US/AVRADCSetup.xml +++ /dev/null @@ -1,83 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from AVRADCSetup.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="AVRADCSetup" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>AVRADCSetup</refname> - <refpurpose>Function to initialise ADC of AVR</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - AVRADCSetup(uint8 prescaler, uint8 adc_ref) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>prescaler:</term> - <listitem><para> prescaler to be used for generating ADC clock (0-7)</para></listitem></varlistentry> - <varlistentry><term>adc_ref :</term> - <listitem><para> reference voltage to be used for ADC conversion</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function initialises ADc of AVR with given parameters. 'prescaler' is needed for deciding ADC clock. ADC clock should be between 50KHz and 200KHz and it given as (MCU clock/2^prescaler). Select appropriate prescaler depending on MCU clock. 'adc_ref' selects one of the available reference voltage sources available. - </para> - <para> -The adc_ref can take the following values- -<itemizedlist> -<listitem><para>0 -> Voltage on VREF pin</para></listitem> -<listitem><para>1 -> Voltage on AVCC pin</para></listitem> -<listitem><para>2 -> Internal 2.56 reference voltage</para></listitem> -</itemizedlist> - </para> - <para> -This is curretly dummy function. It provides no functionality but is required for providing support for generating C code for AVR. - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -AVRADCSetup(128,0) - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="AVRReadADC">AVRReadADC</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - <member>Ashish Kamble</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/AVRDigitalIn.xml b/help/en_US/AVRDigitalIn.xml deleted file mode 100644 index ef87407..0000000 --- a/help/en_US/AVRDigitalIn.xml +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from AVRDigitalIn.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="AVRDigitalIn" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>AVRDigitalIn</refname> - <refpurpose>Function to get state (high\low) of a digital input pin on AVR</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - state=AVRDigitalIn(port,pin) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>port :</term> - <listitem><para> port of microcontroller to be used</para></listitem></varlistentry> - <varlistentry><term>pin :</term> - <listitem><para> pin of port (mentioned above) to be used</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -Each AVR microcontroller has pins which can be configured as digital -inputs. These are normally divided among some 'ports' (group of pins). -User has to select one of these port and which pin of that port as -digital input. - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for AVR. - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -pinA0 = AVRDigitalIn(1,0) //To read state on pin 0 of port A - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="AVRDigitalOut">AVRDigitalSetup</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - <member>Ashish Kamble</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/AVRDigitalOut.xml b/help/en_US/AVRDigitalOut.xml deleted file mode 100644 index 0ce8197..0000000 --- a/help/en_US/AVRDigitalOut.xml +++ /dev/null @@ -1,82 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from AVRDigitalOut.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="AVRDigitalOut" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>AVRDigitalOut</refname> - <refpurpose>Function to change state (high\low) of a digital output pin on AVR</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - AVRDigitalOut(port,pin,state) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>port :</term> - <listitem><para> port of microcontroller to be used</para></listitem></varlistentry> - <varlistentry><term>pin :</term> - <listitem><para> pin of port (mentioned above) to be used</para></listitem></varlistentry> - <varlistentry><term>state :</term> - <listitem><para> state to be outputed on pin (HIGH\LOW)</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -Each AVR microcontroller has pins which can be configured as digital -outputs. These are normally divided among some 'ports' (group of pins). -User has to select one of these port and which pin of that port as -digital output. Also, desired output state must be specified as -'HIGH' or 'LOW'. - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for AVR. - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -AVRDigitalOut('A',0,HIGH) - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="AVRDigitalIn">AVRDigitalIn</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - <member>Ashish Kamble</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/AVRDigitalPortSetup.xml b/help/en_US/AVRDigitalPortSetup.xml deleted file mode 100644 index 8b7b15d..0000000 --- a/help/en_US/AVRDigitalPortSetup.xml +++ /dev/null @@ -1,81 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from AVRDigitalPortSetup.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="AVRDigitalPortSetup" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>AVRDigitalPortSetup</refname> - <refpurpose>Function to decide direction of port on AVR</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - AVRDigitalPortSetup(port,direction) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>port :</term> - <listitem><para> port of microcontroller to be used(1 for PORTA, 2 for PORTB,...)</para></listitem></varlistentry> - <varlistentry><term>direction :</term> - <listitem><para> direction to be set for pin (0 for INPUT, 1 for OUTPUT)</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -Each AVR microcontroller has pins which can be configured as digital -outputs/inputs. These are normally divided among some 'ports' (group of pins). -User has to select one of these port and which pin of that port to be -used as digital output/input. Also, desired direction must be specified as -'INPUT' or 'OUTPUT'. - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for AVR. - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -AVRDigitalPortSetup(1,0); //This function will make PortA as input port - - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="AVRDigitalIn">AVRDigitalOut</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - <member>Ashish Kamble</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/AVRDigitalSetup.xml b/help/en_US/AVRDigitalSetup.xml deleted file mode 100644 index a228573..0000000 --- a/help/en_US/AVRDigitalSetup.xml +++ /dev/null @@ -1,83 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from AVRDigitalSetup.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="AVRDigitalSetup" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>AVRDigitalSetup</refname> - <refpurpose>Function to decide direction of a digital pin on AVR</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - AVRDigitalSetup(port,pin,direction) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>port :</term> - <listitem><para> port of microcontroller to be used</para></listitem></varlistentry> - <varlistentry><term>pin :</term> - <listitem><para> pin of port (mentioned above) to be used</para></listitem></varlistentry> - <varlistentry><term>direction :</term> - <listitem><para> direction to be set for pin (INPUT\OUTPUT)</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -Each AVR microcontroller has pins which can be configured as digital -outputs/inputs. These are normally divided among some 'ports' (group of pins). -User has to select one of these port and which pin of that port to be -used as digital output/input. Also, desired direction must be specified as -'INPUT' or 'OUTPUT'. - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for AVR. - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -AVRDigitalSetup('A',0,OUTPUT) - - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="AVRDigitalIn">AVRDigitalOut</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - <member>Ashish Kamble</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/AVRGetTimerValue.xml b/help/en_US/AVRGetTimerValue.xml deleted file mode 100644 index f639c60..0000000 --- a/help/en_US/AVRGetTimerValue.xml +++ /dev/null @@ -1,73 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from AVRGetTimerValue.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="AVRGetTimerValue" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>AVRGetTimerValue</refname> - <refpurpose>Function to get timer count</refpurpose> - </refnamediv> - - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>timer :</term> - <listitem><para> timer whose current count is to be returned</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function returns the count value of a desired timer.By knowing the count value certain interrupt action can be taken. - </para> - <para> -Timer can take the following values -<itemizedlist> -<listitem><para>0 -> for timer0</para></listitem> -<listitem><para>1 -> for timer1</para></listitem> -<listitem><para>2 -> for timer2</para></listitem> -</itemizedlist> - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for AVR. - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -AVRGetTimerValue(0); //returns present count of the TCNT0 counter - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="AVRTimerSetup">AVRTimerSetup</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Ashish Kamble</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/AVRPWM0SetDuty.xml b/help/en_US/AVRPWM0SetDuty.xml deleted file mode 100644 index a3f2681..0000000 --- a/help/en_US/AVRPWM0SetDuty.xml +++ /dev/null @@ -1,66 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from AVRPWM0SetDuty.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="AVRPWM0SetDuty" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>AVRPWM0SetDuty</refname> - <refpurpose>Function to Set Duty cycle of PWM Output generated by Timer0 at OC0 pin.</refpurpose> - </refnamediv> - - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>duty :</term> - <listitem><para> It holds an integer value from 0 to 100 which sets the percentage of time for which signal is active.</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -Each Micro controller has PWM output pins which can generate varying voltage -from 0V-5V.In this function by varying the duty cycle, varying voltage can be produced. - </para> - <para> -This is curretly dummy function. It provides no functionality but is required for providing support for generating C code for AVR. - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -AVRPWM0SetDuty(50); //Produces 2.5V at OC0 pin -AVRPWM0SetDuty(0); //Produces 0V at OC0 pin - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="AVRPWM0Setup">AVRPWM0Setup</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Ashish Kamble</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/AVRPWM0Setup.xml b/help/en_US/AVRPWM0Setup.xml deleted file mode 100644 index f72f258..0000000 --- a/help/en_US/AVRPWM0Setup.xml +++ /dev/null @@ -1,92 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from AVRPWM0Setup.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="AVRPWM0Setup" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>AVRPWM0Setup</refname> - <refpurpose>Function to Setup OC0 pin for required PWM mode</refpurpose> - </refnamediv> - - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>waveform_mode:</term> - <listitem><para> integer, from 0 to 2</para></listitem></varlistentry> - <varlistentry><term>output_mode:</term> - <listitem><para> integer, from 0 to 1 (or 2) depending on the waveform_mode</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -Every Micro controller has PWM pins which can generate varying voltages -from 0V-5V.This function helps to use OC0 pin to produce required -output waveform by setting the waveform mode and otput mode. - </para> - <para> -waveform_mode can take values- -<itemizedlist> -<listitem><para>0 -> for Phase correct PWM Mode</para></listitem> -<listitem><para>1 -> for Fast PWM Mode</para></listitem> -<listitem><para>2 -> for CTC Mode</para></listitem> -</itemizedlist> - </para> - <para> -output_mode can take values- -<itemizedlist> -For Phase correct PWM Mode: -<listitem><para>0 for Clear OC0 on compare match when up-counting. Set OC0 on compare match when down-counting.</para></listitem> -<listitem><para>1 for Set OC0 on compare match when up-counting. Clear OC0 on compare match when down-counting.</para></listitem> -For Fast PWM Mode: -<listitem><para>0 for non-inverted output i.e Clear OC0 on compare match, set OC0 at BOTTOM.</para></listitem> -<listitem><para>1 for inverted output i.e Set OC0 on compare match, clear OC0 at BOTTOM.</para></listitem> -For CTC Mode: -<listitem><para>0 to Clear OC0 on compare match</para></listitem> -<listitem><para>1 to Set OC0 on compare match</para></listitem> -<listitem><para>2 to toggle OC0 on compare match</para></listitem> -</itemizedlist> - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for AVR. - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -AVRPWM0Setup(2,0); //This function will select CTC waveform mode and will clear OC0 on compare match - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="AVRPWM0SetDuty">AVRPWM0SetDuty</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Ashish Kamble</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/AVRPWM1SetDuty.xml b/help/en_US/AVRPWM1SetDuty.xml deleted file mode 100644 index 83230ea..0000000 --- a/help/en_US/AVRPWM1SetDuty.xml +++ /dev/null @@ -1,66 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from AVRPWM1SetDuty.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="AVRPWM1SetDuty" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>AVRPWM1SetDuty</refname> - <refpurpose>Function to Set Duty cycle of PWM Output generated by Timer1 at OC1A or OC1B pin.</refpurpose> - </refnamediv> - - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>ouput_pin:</term> - <listitem><para> integer, 0 (for OC1A) or 1 (for OC1B)</para></listitem></varlistentry> - <varlistentry><term>duty:</term> - <listitem><para> It holds an integer value from 0 to 100 which sets the percentage of time for which signal is active.</para></listitem></varlistentry> - <varlistentry><term>Top_Value:</term> - <listitem><para> It holds an integer value from 0 to 65535.This value sets the Top value of the counter TCNT1 i.e ICR.(for more info refer datasheet)</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -Each Micro controller has PWM output pins which can generate varying voltage -from 0V-5V.This function Sets the duty cycle of output PWM signal.Also this function -decides the Top Vale of TCNT1 and the output pin to output PWM signal. - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for AVR. - </para> - <para> -Example -AVRPWM1SetDuty(0,50,40000); //This function will produce PWM signal of 50% duty cycle on OC1A pin and TCNT1 will reset at 40000 instead at 65535. -</para> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="AVRPWM1Setup">AVRPWM1Setup</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Ashish Kamble</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/AVRPWM1Setup.xml b/help/en_US/AVRPWM1Setup.xml deleted file mode 100644 index 1498413..0000000 --- a/help/en_US/AVRPWM1Setup.xml +++ /dev/null @@ -1,91 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from AVRPWM1Setup.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="AVRPWM1Setup" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>AVRPWM1Setup</refname> - <refpurpose>Function to Setup OC1A or OC1B pin for required PWM mode</refpurpose> - </refnamediv> - - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>waveform_mode:</term> - <listitem><para> integer, from 0 to 2</para></listitem></varlistentry> - <varlistentry><term>output_mode:</term> - <listitem><para> integer, from 0 to 1 (or 2) depending on the waveform_mode</para></listitem></varlistentry> - <varlistentry><term>output_pin:</term> - <listitem><para> 0 (for OC1A) or 1 for (OC1B)</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -Every Micro controller has PWM pins which can generate varying voltages -from 0V-5V.This function helps to use OC1A or OC1B pin to produces required -output waveform by setting the waveform mode and otput mode. - </para> - <para> -waveform_mode can take values- -<itemizedlist> -<listitem><para>0 -> for Phase correct PWM Mode</para></listitem> -<listitem><para>1 -> for Fast PWM Mode</para></listitem> -<listitem><para>2 -> for CTC Mode</para></listitem> -</itemizedlist> - </para> - <para> -output_mode can take values- -<itemizedlist> -For Phase correct PWM Mode: -<listitem><para>0 for Clear OC1A or OC1B on compare match when up-counting. Set OC1A or OC1B on compare match when down-counting.</para></listitem> -<listitem><para>1 for Set OC1A or OC1B on compare match when up-counting. Clear OC1A or OC1B on compare match when down-counting.</para></listitem> -For Fast PWM Mode: -<listitem><para>0 for non-inverted output i.e Clear OC1A or OC1B on compare match, set OC1A or OC1B at BOTTOM.</para></listitem> -<listitem><para>1 for inverted output i.e Set OC1A or OC1B on compare match, clear OC1A or OC1B at BOTTOM.</para></listitem> -For CTC Mode: -<listitem><para>0 to Clear OC1A or OC1B on compare match</para></listitem> -<listitem><para>1 to Set OC1A or OC1B on compare match</para></listitem> -<listitem><para>2 to toggle OC1A or OC1B on compare match</para></listitem> -</itemizedlist> - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for AVR. - </para> - <para> -Example -AVRPWM1Setup(2,0,0); //This function will select CTC mode and will clear OC1A or OC1B -on compare match.Also as defined the output will be produced at -0C1A pin. -</para> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="AVRPWM1SetDuty">AVRPWM1SetDuty</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Ashish Kamble</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/AVRPWM2SetDuty.xml b/help/en_US/AVRPWM2SetDuty.xml deleted file mode 100644 index d44f0f7..0000000 --- a/help/en_US/AVRPWM2SetDuty.xml +++ /dev/null @@ -1,65 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from AVRPWM2SetDuty.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="AVRPWM2SetDuty" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>AVRPWM2SetDuty</refname> - <refpurpose>Function to Set Duty cycle of PWM Output generated by Timer2 at OC2 pin.</refpurpose> - </refnamediv> - - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>duty :</term> - <listitem><para> It holds an integer value from 0 to 100 which sets the percentage of time for which signal is active.</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -Each Micro controller has PWM output pins which can generate varying voltage -from 0V-5V.In this function by varying the duty cycle, varying voltage can be -produced. - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for AVR. - </para> - <para> -Example -AVRPWM2SetDuty(50); //Produces 2.5V at OC2 pin -AVRPWM2SetDuty(0); //Produces 0V at OC2 pin - </para> - <para> -</para> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="AVRPWM2Setup">AVRPWM2Setup</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Ashish Kamble</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/AVRPWM2Setup.xml b/help/en_US/AVRPWM2Setup.xml deleted file mode 100644 index fe80252..0000000 --- a/help/en_US/AVRPWM2Setup.xml +++ /dev/null @@ -1,88 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from AVRPWM2Setup.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="AVRPWM2Setup" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>AVRPWM2Setup</refname> - <refpurpose>Function to Setup OC2 pin for required PWM mode</refpurpose> - </refnamediv> - - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>waveform_mode:</term> - <listitem><para> integer, from 0 to 2</para></listitem></varlistentry> - <varlistentry><term>output_mode:</term> - <listitem><para> integer, from 0 to 1 (or 2) depending on the waveform_mode</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -Every Micro controller has PWM pins which can generate varying voltages -from 0V-5V.This function helps to use OC2 pin to produces required -output waveform by setting the waveform mode and otput mode. - </para> - <para> -waveform_mode can take values- -<itemizedlist> -<listitem><para>0 -> for Phase correct PWM Mode</para></listitem> -<listitem><para>1 -> for Fast PWM Mode</para></listitem> -<listitem><para>2 -> for CTC Mode</para></listitem> -</itemizedlist> - </para> - <para> -output_mode can take values- -<itemizedlist> -For Phase correct PWM Mode: -<listitem><para>0 for Clear OC2 on compare match when up-counting. Set OC2 on compare match when down-counting.</para></listitem> -<listitem><para>1 for Set OC2 on compare match when up-counting. Clear OC2 on compare match when down-counting.</para></listitem> -For Fast PWM Mode: -<listitem><para>0 for non-inverted output i.e Clear OC2 on compare match, set OC2 at BOTTOM.</para></listitem> -<listitem><para>1 for inverted output i.e Set OC2 on compare match, clear OC2 at BOTTOM.</para></listitem> -For CTC Mode: -<listitem><para>0 to Clear OC2 on compare match</para></listitem> -<listitem><para>1 to Set OC2 on compare match</para></listitem> -<listitem><para>2 to toggle OC2 on compare match</para></listitem> -</itemizedlist> - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for AVR. - </para> - <para> -Example -AVRPWM2Setup(2,0); //This function will select CTC waveform mode and will clear OC2 on -compare match -</para> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="AVRPWM2SetDuty">AVRPWM2SetDuty</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Ashish Kamble</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/AVRReadADC.xml b/help/en_US/AVRReadADC.xml deleted file mode 100644 index abdcad9..0000000 --- a/help/en_US/AVRReadADC.xml +++ /dev/null @@ -1,71 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from AVRReadADC.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="AVRReadADC" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>AVRReadADC</refname> - <refpurpose>Function to get voltage on analog pin on AVR</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - u8AVRReadADCs(channel) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>channel :</term> - <listitem><para> Select which channel is to be read. Values from 0-7 select one of the pins ADC0-ADC7. For other possible channel values refer datasheet</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function returns digital value for present on adc pins. 'channel' -selects which of the ADC0-ADC7 is to be used for reading analog value. -Apart from reading just ADC0-ADC7 other it can also read differential -voltages between some pins. For channel values for those options, please -refer datasheet. - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for AVR. - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -adc_result = u8AVRReadADC(0) //Read ADC0 - ]]></programlisting> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - <member>Ashish Kamble</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/AVRSleep.xml b/help/en_US/AVRSleep.xml deleted file mode 100644 index 3ece53b..0000000 --- a/help/en_US/AVRSleep.xml +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from AVRSleep.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="AVRSleep" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>AVRSleep</refname> - <refpurpose>Function to pause the execution for the given time.</refpurpose> - </refnamediv> - - -<refsection> - <title>Description</title> - <para> -This function causes the execution to stop for the given amount of time. - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for AVR. - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -AVRSleep(5000); - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Jorawar Singh</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/AVRTimerSetup.xml b/help/en_US/AVRTimerSetup.xml deleted file mode 100644 index 420e676..0000000 --- a/help/en_US/AVRTimerSetup.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from AVRTimerSetup.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="AVRTimerSetup" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>AVRTimerSetup</refname> - <refpurpose>Function to setup Timers in ATmega16</refpurpose> - </refnamediv> - - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="AVRGetTimerValues">AVRGetTimerValues</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Ashish Kamble</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/AVRUARTReceive.xml b/help/en_US/AVRUARTReceive.xml deleted file mode 100644 index 84f9510..0000000 --- a/help/en_US/AVRUARTReceive.xml +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from AVRUARTReceive.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="AVRUARTReceive" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>AVRUARTReceive</refname> - <refpurpose>Function to Receive Char value send to ATmega16 using UART or USART.</refpurpose> - </refnamediv> - - -<refsection> - <title>Description</title> - <para> -This function Receives Char as 8 bit value.This value is stored in UDR at receiving -end. - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for AVR. - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -state = AVRUARTReceive(); //This function will Receive char and return the entire value - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="AVRUARTSetup">AVRUARTSetup</link></member> - <member><link linkend="AVRUARTTransmit">AVRUARTTransmit</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Ashish Kamble</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/AVRUARTSetup.xml b/help/en_US/AVRUARTSetup.xml deleted file mode 100644 index 043e265..0000000 --- a/help/en_US/AVRUARTSetup.xml +++ /dev/null @@ -1,90 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from AVRUARTSetup.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="AVRUARTSetup" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>AVRUARTSetup</refname> - <refpurpose>Function to Setup Serial Communication i.e UART or USART in ATmega16.</refpurpose> - </refnamediv> - - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>mode :</term> - <listitem><para> integer, from 0 to 2</para></listitem></varlistentry> - <varlistentry><term>baudrate :</term> - <listitem><para> Enter one of the following available baudrates (2400 , 4800 , 9600 , 14400 , 19200 , 28800 , 38400 , 57600 , 768000 , 115200 , 230400 , 250000 , 1000000)</para></listitem></varlistentry> - <varlistentry><term>stopbits :</term> - <listitem><para> integer, (0 for one stopbit) or (1 for two stopbits)</para></listitem></varlistentry> - <varlistentry><term>parity :</term> - <listitem><para> integer, from 0 to 2</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function Setup the UART or USART for Serial Communicaion between ATmega16 -and different micro controllers or between ATmega16 and Computer. - </para> - <para> -mode can take values: -<itemizedlist> -<listitem><para>0 for Asynchronous Normal mode</para></listitem> -<listitem><para>1 for Asynchronous Double Speed mode</para></listitem> -<listitem><para>2 for Synchronous mode</para></listitem> -</itemizedlist> - </para> - <para> -parity can take values: -<itemizedlist> -<listitem><para>0 for parity disabled</para></listitem> -<listitem><para>1 for even parity</para></listitem> -<listitem><para>2 for odd parity</para></listitem> -</itemizedlist> - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for AVR. - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -AVRUARTSetup(0,9600,0,0); //This function will enable UART Communication for ATmega16 -with 9600 as baudrate,one stop bit and parity disabled - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="AVRUARTTransmit">AVRUARTTransmit</link></member> - <member><link linkend="AVRUARTReceive">AVRUARTReceive</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Ashish Kamble</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/AVRUARTTransmit.xml b/help/en_US/AVRUARTTransmit.xml deleted file mode 100644 index e30e374..0000000 --- a/help/en_US/AVRUARTTransmit.xml +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from AVRUARTTransmit.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="AVRUARTTransmit" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>AVRUARTTransmit</refname> - <refpurpose>Function to Transmit data using UART or USART.</refpurpose> - </refnamediv> - - -<refsection> - <title>Description</title> - <para> -This function Tranmits data over UART or USART.The data to be transmitted can -be a Char , String , Unsigned Int, Signed Int. - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for AVR. - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -AVRUARTTransmit("This is example"); //This function will transmit the entered string. - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="AVRUARTSetup">AVRUARTSetup</link></member> - <member><link linkend="AVRUARTReceive">AVRUARTReceive</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Ashish Kamble</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/CV_AdaptiveThreshold.xml b/help/en_US/CV_AdaptiveThreshold.xml deleted file mode 100644 index 1483442..0000000 --- a/help/en_US/CV_AdaptiveThreshold.xml +++ /dev/null @@ -1,86 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from CV_AdaptiveThreshold.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="CV_AdaptiveThreshold" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>CV_AdaptiveThreshold</refname> - <refpurpose>function to adaptively threshold input image</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - dst = CV_AdaptiveThreshold(srcimg,max_value,adaptive_method,thresh_type,blk_size,c) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>src :</term> - <listitem><para> Source 8-bit single-channel image.</para></listitem></varlistentry> - <varlistentry><term>max_value :</term> - <listitem><para> Non-zero value assigned to the pixels for which the condition is satisfied. See the details below.</para></listitem></varlistentry> - <varlistentry><term>adaptive_method :</term> - <listitem><para> Adaptive thresholding algorithm to use, ADAPTIVE_THRESH_MEAN_C or ADAPTIVE_THRESH_GAUSSIAN_C .</para></listitem></varlistentry> - <varlistentry><term>thresh_type :</term> - <listitem><para> Thresholding type that must be either THRESH_BINARY or THRESH_BINARY_INV .</para></listitem></varlistentry> - <varlistentry><term>blockSize :</term> - <listitem><para> Size of a pixel neighborhood that is used to calculate a threshold value for the pixel: 3, 5, 7, and so on.</para></listitem></varlistentry> - <varlistentry><term>C :</term> - <listitem><para> Constant subtracted from the mean or weighted mean.Normally, it is positive but may be zero or negative as well.</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function can be used for adaptively threshold given image - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for OpenCV - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -img = CV_LoadImage('~/test.jpg',0) -dst = CV_AdaptiveThreshold(img,255,"ADAPTIVE_THRESH_MEAN_C", ... -"THRESH_BINARY",5,0) - - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="CV_LoadImage">CV_CreateImage</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/CV_Blur.xml b/help/en_US/CV_Blur.xml deleted file mode 100644 index 228b310..0000000 --- a/help/en_US/CV_Blur.xml +++ /dev/null @@ -1,92 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from CV_Blur.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="CV_Blur" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>CV_Blur</refname> - <refpurpose>function to blur image using normalised box filter</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - dst = CV_Blur(srcimg,ksize_width,ksize_height,anchor_x,anchor_y,border_type) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>srcimg :</term> - <listitem><para> Source image.</para></listitem></varlistentry> - <varlistentry><term>ksize_width, ksize_height :</term> - <listitem><para> blurring kernel size.</para></listitem></varlistentry> - <varlistentry><term>anchor_x, anchor_y :</term> - <listitem><para> x,y coordinates of anchor point</para></listitem></varlistentry> - <varlistentry><term>border_type :</term> - <listitem><para> border mode used to extrapolate pixels outside of the image.</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function can be used for blurring image using normalised box -filter. Image can be of any depth and have any no of channels. - </para> - <para> -border_type can be : -<itemizedlist> -<listitem>BORDER_REPLICATE: aaaaaa|abcdefgh|hhhhhhh</listitem> -<listitem>BORDER_REFLECT: fedcba|abcdefgh|hgfedcb</listitem> -<listitem>BORDER_REFLECT_101: gfedcb|abcdefgh|gfedcba</listitem> -<listitem>BORDER_WRAP: cdefgh|abcdefgh|abcdefg</listitem> -<listitem>BORDER_CONSTANT: iiiiii|abcdefgh|iiiiiii</listitem> -</itemizedlist> - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for OpenCV - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -img = CV_LoadImage('~/test.jpg',0) -dst = CV_Blur(img,3,3,-1,-1,"BORDER_CONSTANT") - - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="CV_LoadImage">CV_Threshold, CV_CvtColor</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/CV_Canny.xml b/help/en_US/CV_Canny.xml deleted file mode 100644 index daf7f55..0000000 --- a/help/en_US/CV_Canny.xml +++ /dev/null @@ -1,88 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from CV_Canny.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="CV_Canny" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>CV_Canny</refname> - <refpurpose>Finds edges in image using Canny algorithm</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - edges = CV_Canny(srcimg,threhold1,threshold2,aperture_size,L2gradient) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>srcimg :</term> - <listitem><para> single-channel 8-bit input image.</para></listitem></varlistentry> - <varlistentry><term>threshold1 :</term> - <listitem><para> first threshold for the hysteresis procedure.</para></listitem></varlistentry> - <varlistentry><term>threshold2 :</term> - <listitem><para> second threshold for the hysteresis procedure.</para></listitem></varlistentry> - <varlistentry><term>aperture_size :</term> - <listitem><para> aperture size for the Sobel() operator.</para></listitem></varlistentry> - <varlistentry><term>L2gradient :</term> - <listitem><para> a flag, indicating whether a more accurate</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function can be used for finding edes in single channel 8 bit -image. 'aperture_size' and 'L2gradient' are optionals. By default, -aperture_size is 3 and L2gradient is false. - </para> - <para> -For L2gradient: L_2 norm =sqrt{(dI/dx)^2 + (dI/dy)^2} should be used to calculate the image gradient magnitude (L2gradient=1 ), or whether the default L_1 norm =|dI/dx|+|dI/dy| is enough (L2gradient=0). - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for OpenCV - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -img = CV_LoadImage('~/test.jpg',0) -dst = CV_CvtColor(img,"CV_RGB2GRAY"); -edge = CV_Canny(dst,50,100,3,0); - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="CV_LoadImage">CV_CvtColor</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/CV_CornerHarris.xml b/help/en_US/CV_CornerHarris.xml deleted file mode 100644 index e9b9426..0000000 --- a/help/en_US/CV_CornerHarris.xml +++ /dev/null @@ -1,93 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from CV_CornerHarris.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="CV_CornerHarris" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>CV_CornerHarris</refname> - <refpurpose>Finds edges in image using Harris algorithm</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - edges = CV_CornerHarris(srcimg,blocksize,ksize,k,border_type) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>srcimg:</term> - <listitem><para> Input single-channel 8-bit or floating-point image.</para></listitem></varlistentry> - <varlistentry><term>blockSize:</term> - <listitem><para> Neighborhood size</para></listitem></varlistentry> - <varlistentry><term>ksize:</term> - <listitem><para> Aperture parameter for the Sobel() operator.</para></listitem></varlistentry> - <varlistentry><term>k:</term> - <listitem><para> Harris detector free parameter.</para></listitem></varlistentry> - <varlistentry><term>border_type:</term> - <listitem><para> border mode used to extrapolate pixels outside of the image.</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -The function runs the Harris edge detector on the image. For each pixel (x, y) it calculates a 2 * 2 gradient covariance matrix M(x,y) over a blockSize * blockSize neighborhood. Then, it computes the following characteristic: dst(x,y) = det(M(x,y)) - k .tr(M(x,y))^2. Corners in the image can be found as the local maxima of this response map. - </para> - <para> -border_type can be : -<itemizedlist> -<listitem>BORDER_REPLICATE: aaaaaa|abcdefgh|hhhhhhh</listitem> -<listitem>BORDER_REFLECT: fedcba|abcdefgh|hgfedcb</listitem> -<listitem>BORDER_REFLECT_101: gfedcb|abcdefgh|gfedcba</listitem> -<listitem>BORDER_WRAP: cdefgh|abcdefgh|abcdefg</listitem> -<listitem>BORDER_CONSTANT: iiiiii|abcdefgh|iiiiiii</listitem> -</itemizedlist> - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for OpenCV - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -img = CV_LoadImage('~/test.jpg',0) -dst = CV_CvtColor(img,"CV_RGB2GRAY"); -edge = CV_CornerHarris(dst,5,3,1,"BORDER_REPLICATE"); - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="CV_LoadImage">CV_CvtColor</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/CV_CreateImage.xml b/help/en_US/CV_CreateImage.xml deleted file mode 100644 index 45fde56..0000000 --- a/help/en_US/CV_CreateImage.xml +++ /dev/null @@ -1,76 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from CV_CreateImage.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="CV_CreateImage" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>CV_CreateImage</refname> - <refpurpose>function to create an image object of given size and type</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - CV_CreateImage(image_size,bit_depth,no_of_channels) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>image_size:</term> - <listitem><para> width and height of image</para></listitem></varlistentry> - <varlistentry><term>bit_depth:</term> - <listitem><para> Bit depth of image elements</para></listitem></varlistentry> - <varlistentry><term>no_of_channels:</term> - <listitem><para> no of channels per pixels</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function can be used to create opencv image object. For more info about bit depth and channels,please refer to OpenCV documentation - </para> - <para> -This is curretly dummy function. It provides no functionality but is required for providing support for generating C code for OpenCV - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -CV_CreateImage([320 240], "IPL_DEPTH_8U", 1) //to create image of the size 320*240 pixels with 8 bit unsigned each pixels and gray scale image - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="CV_LoadImage">CV_LoadImage</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/CV_CvtColor.xml b/help/en_US/CV_CvtColor.xml deleted file mode 100644 index f1f25e0..0000000 --- a/help/en_US/CV_CvtColor.xml +++ /dev/null @@ -1,81 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from CV_CvtColor.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="CV_CvtColor" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>CV_CvtColor</refname> - <refpurpose>function to convert image from one colorspace to other colorspace</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - CV_CvtColor(srcimg,code) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>srcimg:</term> - <listitem><para> source image to be converted</para></listitem></varlistentry> - <varlistentry><term>dstimg:</term> - <listitem><para> destination image in which to store converted image</para></listitem></varlistentry> - <varlistentry><term>code:</term> - <listitem><para> String specifying conversion type. Same as defined in OpenCV. for eg. 'CV_RGB2GRAY' for conversion from RGB image to grayscale image</para></listitem></varlistentry> - <varlistentry><term>dstCn:</term> - <listitem><para> no of channels in destination image (0 by default)</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function can be used for converting an image to other colorspace. -Refer OpenCV documentation for list of available conversions - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for OpenCV - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -img = CV_LoadImage('~/test.jpg',0) -dst = CV_CvtColor(img,'CV_RGB2GRAY') - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="CV_LoadImage">CV_CreateImage</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/CV_Dilate.xml b/help/en_US/CV_Dilate.xml deleted file mode 100644 index d01b3ab..0000000 --- a/help/en_US/CV_Dilate.xml +++ /dev/null @@ -1,93 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from CV_Dilate.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="CV_Dilate" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>CV_Dilate</refname> - <refpurpose>dilates an image by using a specific structuring element.</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - cvtimg = CV_Dilate(srcimg,dilation_type,dilation_size,[iterations,border_type,border_value]) - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>src :</term> - <listitem><para> input image; the number of channels can be arbitrary, but the depth should be one of CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.</para></listitem></varlistentry> - <varlistentry><term>dilation_type :</term> - <listitem><para> can be one of MORPH_RECT, MORPH_CROSS,MORPH_ELLIPSE</para></listitem></varlistentry> - <varlistentry><term>dilation_size :</term> - <listitem><para> size of kernel to be used for erosion. Must be odd</para></listitem></varlistentry> - <varlistentry><term>iterations :</term> - <listitem><para> number of times erosion is applied.</para></listitem></varlistentry> - <varlistentry><term>border_type :</term> - <listitem><para> pixel extrapolation method.</para></listitem></varlistentry> - <varlistentry><term>border_value :</term> - <listitem><para> border value in case of a constant border</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function can be used for eroding an image. Kernel used for erosion is decided by type and size. Size must always be odd. Anchor pint of kernel is always center of kernel. Input arguements 'iterations(1), border_type(BORDER_CONSTANT) and border_value' are optionals. Whwn not specified, default values as as mentioned in brackets. - </para> - <para> -border_type can be : -<itemizedlist> -<listitem><para> BORDER_REPLICATE: aaaaaa|abcdefgh|hhhhhhh </para></listitem> -<listitem><para> BORDER_REFLECT: fedcba|abcdefgh|hgfedcb </para></listitem> -<listitem><para> BORDER_REFLECT_101: gfedcb|abcdefgh|gfedcba </para></listitem> -<listitem><para> BORDER_WRAP: cdefgh|abcdefgh|abcdefg </para></listitem> -<listitem><para> BORDER_CONSTANT: iiiiii|abcdefgh|iiiiiii </para></listitem> -</itemizedlist> - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for OpenCV - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -img = CV_LoadImage('~/test.jpg',0) -dst = CV_Erode(img,"MORPH_RECT",3,1,"BORDER_CONSTANT",0); - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="CV_LoadImage">CV_Erode</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/CV_DistanceTransform.xml b/help/en_US/CV_DistanceTransform.xml deleted file mode 100644 index 0792999..0000000 --- a/help/en_US/CV_DistanceTransform.xml +++ /dev/null @@ -1,78 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from CV_DistanceTransform.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="CV_DistanceTransform" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>CV_DistanceTransform</refname> - <refpurpose>function to calculate distance to closest zero pixels for each pixel</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - dst = CV_DistanceTransform(srcimg,distance_type,mask_size) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>srcimg :</term> - <listitem><para> Source 8-bit single-channel image.</para></listitem></varlistentry> - <varlistentry><term>distance_type :</term> - <listitem><para> Type of distance. It can be CV_DIST_L1, CV_DIST_L2 , or CV_DIST_C</para></listitem></varlistentry> - <varlistentry><term>mask_size :</term> - <listitem><para> Size of the distance transform mask</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function can be used to calculate distance to closest zero pixel for each pixel of the source image. Output is 32 bit floatingpoint, single channel image of the same size as that of source image. - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for OpenCV - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -img = CV_LoadImage('~/test.jpg',0) -dst = CV_DistanceTransform(img,"CV_DIST_L1",3) - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="CV_LoadImage">CV_CreateImage CV_CvtColor</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/CV_Erode.xml b/help/en_US/CV_Erode.xml deleted file mode 100644 index 103d489..0000000 --- a/help/en_US/CV_Erode.xml +++ /dev/null @@ -1,93 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from CV_Erode.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="CV_Erode" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>CV_Erode</refname> - <refpurpose>Erodes an image by using a specific structuring element.</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - cvtimg = CV_Erode(srcimg,erosion_type,erosion_size,[iterations,border_type,border_value]) - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>src :</term> - <listitem><para> input image; the number of channels can be arbitrary, but the depth should be one of CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.</para></listitem></varlistentry> - <varlistentry><term>erosion_type :</term> - <listitem><para> can be one of : MORPH_RECT, MORPH_CROSS, MORPH_ELLIPSE</para></listitem></varlistentry> - <varlistentry><term>erosion_size :</term> - <listitem><para> size of kernel to be used for erosion. Must be odd</para></listitem></varlistentry> - <varlistentry><term>iterations :</term> - <listitem><para> number of times erosion is applied.</para></listitem></varlistentry> - <varlistentry><term>border_type :</term> - <listitem><para> pixel extrapolation method.</para></listitem></varlistentry> - <varlistentry><term>border_value :</term> - <listitem><para> border value in case of a constant border</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function can be used for eroding an image. Kernel used for erosion is decided by type and size. Size must always be odd. Anchor pint of kernel is always center of kernel. Input arguements 'iterations(1), border_type(BORDER_CONSTANT) and border_value' are optionals. Whwn not specified, default values as as mentioned in brackets. - </para> - <para> -border_type can be : -<itemizedlist> -<listitem>BORDER_REPLICATE: aaaaaa|abcdefgh|hhhhhhh</listitem> -<listitem>BORDER_REFLECT: fedcba|abcdefgh|hgfedcb</listitem> -<listitem>BORDER_REFLECT_101: gfedcb|abcdefgh|gfedcba</listitem> -<listitem>BORDER_WRAP: cdefgh|abcdefgh|abcdefg</listitem> -<listitem>BORDER_CONSTANT: iiiiii|abcdefgh|iiiiiii</listitem> -</itemizedlist> - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for OpenCV - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -img = CV_LoadImage('~/test.jpg',0) -dst = CV_Erode(img,"MORPH_RECT",3,1,"BORDER_CONSTANT",0); - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="CV_LoadImage">CV_Dilate</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/CV_GaussianBlur.xml b/help/en_US/CV_GaussianBlur.xml deleted file mode 100644 index 88a8f33..0000000 --- a/help/en_US/CV_GaussianBlur.xml +++ /dev/null @@ -1,95 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from CV_GaussianBlur.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="CV_GaussianBlur" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>CV_GaussianBlur</refname> - <refpurpose>function to blur image using gaussian filter</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - cvtimg = CV_GaussianBlur(srcimg,ksize_width,ksize_height,sigma_x,sigma_y,border_type) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>srcimg :</term> - <listitem><para> Source image.</para></listitem></varlistentry> - <varlistentry><term>ksize_width, ksize_height :</term> - <listitem><para> blurring kernel size. must be odd.</para></listitem></varlistentry> - <varlistentry><term>sigmaX :</term> - <listitem><para> Gaussian kernel standard deviation in X direction.</para></listitem></varlistentry> - <varlistentry><term>sigmaY :</term> - <listitem><para> Gaussian kernel standard deviation in Y direction;</para></listitem></varlistentry> - <varlistentry><term>border_type :</term> - <listitem><para> border mode used to extrapolate pixels outside of the image.</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function can be used for blurring image using gaussian filter. Image can be of any depth and have any no of channels. - </para> - <para> -For sigmaX and sigmaY : if sigmaY is zero, it is set to be equal to sigmaX, if both sigmas are zeros, they are computed from ksize.width and ksize.height , respectively. - </para> - <para> -border_type can be : -<itemizedlist> -<listitem>BORDER_REPLICATE: aaaaaa|abcdefgh|hhhhhhh</listitem> -<listitem>BORDER_REFLECT: fedcba|abcdefgh|hgfedcb</listitem> -<listitem>BORDER_REFLECT_101: gfedcb|abcdefgh|gfedcba</listitem> -<listitem>BORDER_WRAP: cdefgh|abcdefgh|abcdefg</listitem> -<listitem>BORDER_CONSTANT: iiiiii|abcdefgh|iiiiiii</listitem> -</itemizedlist> - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for OpenCV - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -img = CV_LoadImage('~/test.jpg',0) -dst = CV_GaussianBlur(img,3,3,0,0,"BORDER_CONSTANT") - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="CV_LoadImage">CV_Blur, CV_CvtColor</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/CV_GetImgSize.xml b/help/en_US/CV_GetImgSize.xml deleted file mode 100644 index 717c808..0000000 --- a/help/en_US/CV_GetImgSize.xml +++ /dev/null @@ -1,75 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from CV_GetImgSize.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="CV_GetImgSize" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>CV_GetImgSize</refname> - <refpurpose>function to get size of the image (width*height)</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - CV_GetImgSize(img) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>img:</term> - <listitem><para> image whose size is to be returned</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function can be used for retriving size information of the image. -It returs an array with first image element as width and second as height - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for OpenCV - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -img = CV_LoadImage('~/test.jpg',0) -size = CV_GetImgSize(img) - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="CV_LoadImage">CV_CreateImage</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/CV_LoadImage.xml b/help/en_US/CV_LoadImage.xml deleted file mode 100644 index 70f55c8..0000000 --- a/help/en_US/CV_LoadImage.xml +++ /dev/null @@ -1,83 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from CV_LoadImage.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="CV_LoadImage" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>CV_LoadImage</refname> - <refpurpose>function to load an image object from given filename</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - CV_LoadImage(filename,loadtype) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>filename:</term> - <listitem><para> name of file to be opened</para></listitem></varlistentry> - <varlistentry><term>loadtype:</term> - <listitem><para> desired load method</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function can be used for loading a previously stored image - </para> - <para> -loadtype can take the following values: -<itemizedlist> -<listitem><para> less than 0 -> image is loaded as is (with alpha channel)</para></listitem> -<listitem><para> 0 -> image is loaded as greyscale</para></listitem> -<listitem><para> greater than 0 -> 3 channel color image is loaded</para></listitem> -</itemizedlist> - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for OpenCV - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -CV_LoadImage('~/test.jpg',0) - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="CV_CreateImage">CV_CreateImage</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/CV_MedianBlur.xml b/help/en_US/CV_MedianBlur.xml deleted file mode 100644 index d10291c..0000000 --- a/help/en_US/CV_MedianBlur.xml +++ /dev/null @@ -1,77 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from CV_MedianBlur.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="CV_MedianBlur" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>CV_MedianBlur</refname> - <refpurpose>function to blur image using median filter</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - cvtimg = CV_MedianBlur(srcimg,ksize) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>srcimg :</term> - <listitem><para> input 1-, 3-, or 4-channel image; when ksize is 3 or 5, the image depth should be CV_8U, CV_16U, or CV_32F, for larger aperture sizes, it can only be CV_8U.</para></listitem></varlistentry> - <varlistentry><term>ksize_width :</term> - <listitem><para> aperture linear size; it must be odd and greater than 1, for example: 3, 5, 7 ...</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function can be used for blurring image using median -filter. Image can be of any depth and have any no of channels. - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for OpenCV - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -img = CV_LoadImage('~/test.jpg',0) -dst = CV_MedianBlur(img,3) - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="CV_GaussianBlur,">CV_Blur, CV_CvtColor</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/CV_SaveImage.xml b/help/en_US/CV_SaveImage.xml deleted file mode 100644 index 9e73200..0000000 --- a/help/en_US/CV_SaveImage.xml +++ /dev/null @@ -1,77 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from CV_SaveImage.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="CV_SaveImage" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>CV_SaveImage</refname> - <refpurpose>function to save an image object as a given filename</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - CV_SaveImage(filename,img) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>filename:</term> - <listitem><para> name of file image to be saved as</para></listitem></varlistentry> - <varlistentry><term>img:</term> - <listitem><para> image to be saved</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function can be used for saving image. File format is detected -from file extension - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for OpenCV - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -img = CV_LoadImage('~/test.jpg',0) -CV_SaveImage('test1.png',img) - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="CV_LoadImage">CV_CreateImage</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/CV_ShowImage.xml b/help/en_US/CV_ShowImage.xml deleted file mode 100644 index e3f6e67..0000000 --- a/help/en_US/CV_ShowImage.xml +++ /dev/null @@ -1,77 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from CV_ShowImage.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="CV_ShowImage" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>CV_ShowImage</refname> - <refpurpose>function to show an image</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - CV_ShowImage(img) - CV_ShowImage(winname,img) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>winname:</term> - <listitem><para> name of window in which img is to be shown</para></listitem></varlistentry> - <varlistentry><term>img:</term> - <listitem><para> image to be shown already acquired (from file/camera)</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function can be used for showing images - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for OpenCV - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -img = CV_LoadImage('~/test.jpg',0) -CV_ShowImage(img) - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="CV_CreateImage">CV_LoadImage</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/CV_Threshold.xml b/help/en_US/CV_Threshold.xml deleted file mode 100644 index 0de0c14..0000000 --- a/help/en_US/CV_Threshold.xml +++ /dev/null @@ -1,81 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from CV_Threshold.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="CV_Threshold" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>CV_Threshold</refname> - <refpurpose>function to threshold input image</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - dst = CV_Threshold(srcimg,code,threshold,max_value,thresh_type) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>srcimg:</term> - <listitem><para> source image to be converted</para></listitem></varlistentry> - <varlistentry><term>threshold:</term> - <listitem><para> threshold value</para></listitem></varlistentry> - <varlistentry><term>max_value:</term> - <listitem><para> maximum value to be used with THRESH_BINARY and THRESH_BINARY_INV</para></listitem></varlistentry> - <varlistentry><term>thresh_type:</term> - <listitem><para> Type for threshold. It can one of the following: THRESH_BINARY, THRESH_BINARY_INV, THRESH_TRUNC, THRESH_TOZERO, THRESH_TOZERO_INV</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function can be used for converting an image to other colorspace. -Refer OpenCV documentation for list of available conversions - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for OpenCV - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -img = CV_LoadImage('~/test.jpg',0) -dst = CV_Threshold(img,100,255,'THRESH_BINARY') - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="CV_LoadImage">CV_CreateImage</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/CV_WaitKey.xml b/help/en_US/CV_WaitKey.xml deleted file mode 100644 index 9b52707..0000000 --- a/help/en_US/CV_WaitKey.xml +++ /dev/null @@ -1,76 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - * - * This help file was generated from CV_WaitKey.sci using help_from_sci(). - * - --> - -<refentry version="5.0-subset Scilab" xml:id="CV_WaitKey" xml:lang="en" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:ns3="http://www.w3.org/1999/xhtml" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:scilab="http://www.scilab.org" - xmlns:db="http://docbook.org/ns/docbook"> - - <refnamediv> - <refname>CV_WaitKey</refname> - <refpurpose>function similar to cvWaitKey</refpurpose> - </refnamediv> - - -<refsynopsisdiv> - <title>Calling Sequence</title> - <synopsis> - CV_WaitKey(delay) - - </synopsis> -</refsynopsisdiv> - -<refsection> - <title>Parameters</title> - <variablelist> - <varlistentry><term>delay:</term> - <listitem><para> waiting delay, if 0 then wait till keypress</para></listitem></varlistentry> - </variablelist> -</refsection> - -<refsection> - <title>Description</title> - <para> -This function can be used for inseting some delay. This function must -follow CV_ShowImage to display image. - </para> - <para> -This is curretly dummy function. It provides no functionality but is required -for providing support for generating C code for OpenCV - </para> - <para> -</para> -</refsection> - -<refsection> - <title>Examples</title> - <programlisting role="example"><![CDATA[ -img = CV_LoadImage('~/test.jpg',0) -CV_ShowImage('',img) -CV_WaitKey(0); - ]]></programlisting> -</refsection> - -<refsection> - <title>See also</title> - <simplelist type="inline"> - <member><link linkend="CV_LoadImage">CV_ShowImage</link></member> - </simplelist> -</refsection> - -<refsection> - <title>Authors</title> - <simplelist type="vert"> - <member>Siddhesh Wani</member> - </simplelist> -</refsection> -</refentry> diff --git a/help/en_US/master_help.xml b/help/en_US/master_help.xml deleted file mode 100644 index 8936dc7..0000000 --- a/help/en_US/master_help.xml +++ /dev/null @@ -1,91 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE book [ -<!--Begin Entities--> -<!ENTITY a4ced7d2e9b67c3e5f5d8dec5c4c2a7b5 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/AVRADCSetup.xml"> -<!ENTITY a5f5c61e585d010e92f93094110917ca7 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/AVRDigitalIn.xml"> -<!ENTITY a35188be2c73a9ca19f826716928f3ec9 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/AVRDigitalOut.xml"> -<!ENTITY a69e1a047bede352c51cedd397734970f SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/AVRDigitalPortSetup.xml"> -<!ENTITY a4cc0c4a0736a186fd8c793a5931c4974 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/AVRDigitalSetup.xml"> -<!ENTITY a5894e1a7b54b82b85c5ad8af0b1fa6d5 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/AVRGetTimerValue.xml"> -<!ENTITY a783ceb667c7a8409726cf9adce661d88 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/AVRPWM0SetDuty.xml"> -<!ENTITY a23fd74c6d855b2964b0bfa857431ea4a SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/AVRPWM0Setup.xml"> -<!ENTITY a2172fe9e4db1b8e833d86308dd94c6a3 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/AVRPWM1SetDuty.xml"> -<!ENTITY abdab8d756ed35d367b06e6dde1621452 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/AVRPWM1Setup.xml"> -<!ENTITY a2933bc0f9cb3180a9026a202f6e74590 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/AVRPWM2SetDuty.xml"> -<!ENTITY a7221cb8544366ee2c816b8ccd9664883 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/AVRPWM2Setup.xml"> -<!ENTITY a6612fc748e40a8aea75010ec106c07fe SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/AVRReadADC.xml"> -<!ENTITY a2b293f8ed8c22852ce431697b92a08eb SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/AVRSleep.xml"> -<!ENTITY a9496bc0a5f790d45b011fb50692abf85 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/AVRTimerSetup.xml"> -<!ENTITY ab35f22a34eb52742144ead9a681dda20 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/AVRUARTReceive.xml"> -<!ENTITY a125927a7acbaea7fd55fc0580cdf7b79 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/AVRUARTSetup.xml"> -<!ENTITY a22ff1d79d2ef02736de34d1a658093a8 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/AVRUARTTransmit.xml"> -<!ENTITY a17a4e1ba842d5ef2d7d0b0d35bf94aa1 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/CV_AdaptiveThreshold.xml"> -<!ENTITY abfcde272e39230f785989a224e21806a SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/CV_Blur.xml"> -<!ENTITY a839bbf0799d5751e818f9e4fbbd722d4 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/CV_Canny.xml"> -<!ENTITY af4f7e0bd9a31d7525b132608f90064ba SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/CV_CornerHarris.xml"> -<!ENTITY a3ea3eceb6bebf9b13469ddf273bf27f0 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/CV_CreateImage.xml"> -<!ENTITY abd061b61493b58398c19b824f8a3429a SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/CV_CvtColor.xml"> -<!ENTITY a4cef09c6efafa5d24963cd3092dda406 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/CV_Dilate.xml"> -<!ENTITY ace749f1d0fa9b20d8932a3f5609c8333 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/CV_DistanceTransform.xml"> -<!ENTITY a02ff94de28ead9bc5cc0d97fae412854 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/CV_Erode.xml"> -<!ENTITY a1060701fdb8180ecad0c30f52d23871e SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/CV_GaussianBlur.xml"> -<!ENTITY aa9df078994f9e82d214198518454245f SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/CV_GetImgSize.xml"> -<!ENTITY a11167a6869d5fec4c77d30b72498da29 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/CV_LoadImage.xml"> -<!ENTITY a5f57d860917ba6a90f92b977254a30f9 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/CV_MedianBlur.xml"> -<!ENTITY a2c8500afd93e0ba9a67168cdd3d991ae SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/CV_SaveImage.xml"> -<!ENTITY ad1a62a529d62218dc5cee6c4e3edfa83 SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/CV_ShowImage.xml"> -<!ENTITY ab304d0ea2d0c8c73d960e5366f436edf SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/CV_Threshold.xml"> -<!ENTITY a65d0226eae804ea7a9b3855bb4bdee2a SYSTEM "/home/ukasha/fosseeScilab2c/Scilab2C-1/2.3-1/help/en_US/CV_WaitKey.xml"> -<!--End Entities--> -]> -<book version="5.0-subset Scilab" xml:lang="en_US" - xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:xi="http://www.w3.org/2001/XInclude" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns:mml="http://www.w3.org/1998/Math/MathML" - xmlns:html="http://www.w3.org/1999/xhtml" - xmlns:db="http://docbook.org/ns/docbook"> - <info xml:id='scilab_2_c_converter_manual'> - <title>Scilab 2 C Converter</title> - </info> - -<part xml:id='section_c48c685480bb84e36e8d74b86cea528a'> -<title>Scilab 2 C Converter</title> -&a4ced7d2e9b67c3e5f5d8dec5c4c2a7b5; -&a5f5c61e585d010e92f93094110917ca7; -&a35188be2c73a9ca19f826716928f3ec9; -&a69e1a047bede352c51cedd397734970f; -&a4cc0c4a0736a186fd8c793a5931c4974; -&a5894e1a7b54b82b85c5ad8af0b1fa6d5; -&a783ceb667c7a8409726cf9adce661d88; -&a23fd74c6d855b2964b0bfa857431ea4a; -&a2172fe9e4db1b8e833d86308dd94c6a3; -&abdab8d756ed35d367b06e6dde1621452; -&a2933bc0f9cb3180a9026a202f6e74590; -&a7221cb8544366ee2c816b8ccd9664883; -&a6612fc748e40a8aea75010ec106c07fe; -&a2b293f8ed8c22852ce431697b92a08eb; -&a9496bc0a5f790d45b011fb50692abf85; -&ab35f22a34eb52742144ead9a681dda20; -&a125927a7acbaea7fd55fc0580cdf7b79; -&a22ff1d79d2ef02736de34d1a658093a8; -&a17a4e1ba842d5ef2d7d0b0d35bf94aa1; -&abfcde272e39230f785989a224e21806a; -&a839bbf0799d5751e818f9e4fbbd722d4; -&af4f7e0bd9a31d7525b132608f90064ba; -&a3ea3eceb6bebf9b13469ddf273bf27f0; -&abd061b61493b58398c19b824f8a3429a; -&a4cef09c6efafa5d24963cd3092dda406; -&ace749f1d0fa9b20d8932a3f5609c8333; -&a02ff94de28ead9bc5cc0d97fae412854; -&a1060701fdb8180ecad0c30f52d23871e; -&aa9df078994f9e82d214198518454245f; -&a11167a6869d5fec4c77d30b72498da29; -&a5f57d860917ba6a90f92b977254a30f9; -&a2c8500afd93e0ba9a67168cdd3d991ae; -&ad1a62a529d62218dc5cee6c4e3edfa83; -&ab304d0ea2d0c8c73d960e5366f436edf; -&a65d0226eae804ea7a9b3855bb4bdee2a; -</part> -</book> diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS Binary files differindex 4c372c4..ef46423 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB index 85316e5..e3c71bf 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB @@ -1,2 +1 @@ -eÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ÷_ÿÿÿÿÿÿÿÿý×ÿÿÿÿÿý×ÿÿuÿÿÿÿÿÿuÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÝÿÿÿÝÿÿÿÿÿÿÝÿÿÿÿý×ÿÿÿÿÿÿÿÿÿÿÿý×ÿÿÿÿÿ÷_ÿÿÿÿÿÿÝ÷W]͉ÿÿÿÝÿÿÿüÒÿÿÝ÷_0ŸÿÿÿuÿÿÿÝÿÿÿÿÿ0ŸÿÿÿÿÿÝýÕ×ý×ý×ÿÿÿÿÿÿÿÝ}×ÿÌ'ÿÐ<r¡lraa—¡#E†
,Lñ£EŒ…ʇŠ4±ÜPcbÆ„¨wÄŒ˜ªÿïòÄ¡Òª2…Æqa±|kA*7h£Š<dP¸Â¨Ñ‘e,dJ,[¢ŒŠ6(dK9Já±+<¡‘zª£ú«„£¨lJ†D¯5èg‹ãFD³ -ú4`R+2+«0ªª¨ßÿÿÿ骨ª8º5Ê;ÆEÿäe§I•×Ë2‹?î´âŒ§J©Õ«úëú—z¥Þ†ëª©Z•êJªªªªªŠî0ªªªøªªêª0ª¼Òͨ¿0³j/ÿÿüÒÿÿÿÿ4¿üÒÌ/ÿÿÿÿÿÿÿÿÿÿÿÿÌ/ÿÿÿÿÿÿÿÿÿÿüÂÿ2/ÿÿÿÿÿÿÿÿÿÿÿÿÿö
\ No newline at end of file +eÿÐjª`
\ No newline at end of file diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS b/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS Binary files differindex 7a03620..1324712 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS b/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS Binary files differindex 923e5b8..9c9d28d 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA b/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA index a427273..a646b00 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA @@ -1,2 +1,2 @@ JavaSearch 1.0 -TMAP bs=2048 rt=1 fl=-1 id1=731 id2=1 +TMAP bs=2048 rt=0 fl=-1 id1=10 id2=1 diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP b/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP Binary files differindex 08d2204..ee0149c 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP diff --git a/help/en_US/scilab_en_US_help/jhelpidx.xml b/help/en_US/scilab_en_US_help/jhelpidx.xml deleted file mode 100644 index aa5a66e..0000000 --- a/help/en_US/scilab_en_US_help/jhelpidx.xml +++ /dev/null @@ -1,3 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="no"?> -<!DOCTYPE index PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp Index Version 1.0//EN" "http://java.sun.com/products/javahelp/index_1_0.dtd"> -<index version="1.0"/>
\ No newline at end of file diff --git a/help/en_US/scilab_en_US_help/jhelpmap.jhm b/help/en_US/scilab_en_US_help/jhelpmap.jhm index 855b418..cdbcb20 100644 --- a/help/en_US/scilab_en_US_help/jhelpmap.jhm +++ b/help/en_US/scilab_en_US_help/jhelpmap.jhm @@ -2,40 +2,4 @@ <!DOCTYPE map PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp Map Version 1.0//EN" "http://java.sun.com/products/javahelp/map_1_0.dtd"> <map version="1.0"> <mapID target="index" url="index.html"/> -<mapID target="section_c48c685480bb84e36e8d74b86cea528a" url="section_c48c685480bb84e36e8d74b86cea528a.html"/> -<mapID target="AVRADCSetup" url="AVRADCSetup.html"/> -<mapID target="AVRDigitalIn" url="AVRDigitalIn.html"/> -<mapID target="AVRDigitalOut" url="AVRDigitalOut.html"/> -<mapID target="AVRDigitalPortSetup" url="AVRDigitalPortSetup.html"/> -<mapID target="AVRDigitalSetup" url="AVRDigitalSetup.html"/> -<mapID target="AVRGetTimerValue" url="AVRGetTimerValue.html"/> -<mapID target="AVRPWM0SetDuty" url="AVRPWM0SetDuty.html"/> -<mapID target="AVRPWM0Setup" url="AVRPWM0Setup.html"/> -<mapID target="AVRPWM1SetDuty" url="AVRPWM1SetDuty.html"/> -<mapID target="AVRPWM1Setup" url="AVRPWM1Setup.html"/> -<mapID target="AVRPWM2SetDuty" url="AVRPWM2SetDuty.html"/> -<mapID target="AVRPWM2Setup" url="AVRPWM2Setup.html"/> -<mapID target="AVRReadADC" url="AVRReadADC.html"/> -<mapID target="AVRSleep" url="AVRSleep.html"/> -<mapID target="AVRTimerSetup" url="AVRTimerSetup.html"/> -<mapID target="AVRUARTReceive" url="AVRUARTReceive.html"/> -<mapID target="AVRUARTSetup" url="AVRUARTSetup.html"/> -<mapID target="AVRUARTTransmit" url="AVRUARTTransmit.html"/> -<mapID target="CV_AdaptiveThreshold" url="CV_AdaptiveThreshold.html"/> -<mapID target="CV_Blur" url="CV_Blur.html"/> -<mapID target="CV_Canny" url="CV_Canny.html"/> -<mapID target="CV_CornerHarris" url="CV_CornerHarris.html"/> -<mapID target="CV_CreateImage" url="CV_CreateImage.html"/> -<mapID target="CV_CvtColor" url="CV_CvtColor.html"/> -<mapID target="CV_Dilate" url="CV_Dilate.html"/> -<mapID target="CV_DistanceTransform" url="CV_DistanceTransform.html"/> -<mapID target="CV_Erode" url="CV_Erode.html"/> -<mapID target="CV_GaussianBlur" url="CV_GaussianBlur.html"/> -<mapID target="CV_GetImgSize" url="CV_GetImgSize.html"/> -<mapID target="CV_LoadImage" url="CV_LoadImage.html"/> -<mapID target="CV_MedianBlur" url="CV_MedianBlur.html"/> -<mapID target="CV_SaveImage" url="CV_SaveImage.html"/> -<mapID target="CV_ShowImage" url="CV_ShowImage.html"/> -<mapID target="CV_Threshold" url="CV_Threshold.html"/> -<mapID target="CV_WaitKey" url="CV_WaitKey.html"/> </map>
\ No newline at end of file diff --git a/help/en_US/scilab_en_US_help/jhelptoc.xml b/help/en_US/scilab_en_US_help/jhelptoc.xml deleted file mode 100644 index 7ac7e46..0000000 --- a/help/en_US/scilab_en_US_help/jhelptoc.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="no"?> -<!DOCTYPE toc PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp TOC Version 1.0//EN" "http://java.sun.com/products/javahelp/toc_1_0.dtd"> -<toc version="1.0"> -<tocitem target="index" text="Scilab 2 C Converter"> -<tocitem target="section_c48c685480bb84e36e8d74b86cea528a" text="Scilab 2 C Converter"> -<tocitem target="AVRADCSetup" text="AVRADCSetup"/> -<tocitem target="AVRDigitalIn" text="AVRDigitalIn"/> -<tocitem target="AVRDigitalOut" text="AVRDigitalOut"/> -<tocitem target="AVRDigitalPortSetup" text="AVRDigitalPortSetup"/> -<tocitem target="AVRDigitalSetup" text="AVRDigitalSetup"/> -<tocitem target="AVRGetTimerValue" text="AVRGetTimerValue"/> -<tocitem target="AVRPWM0SetDuty" text="AVRPWM0SetDuty"/> -<tocitem target="AVRPWM0Setup" text="AVRPWM0Setup"/> -<tocitem target="AVRPWM1SetDuty" text="AVRPWM1SetDuty"/> -<tocitem target="AVRPWM1Setup" text="AVRPWM1Setup"/> -<tocitem target="AVRPWM2SetDuty" text="AVRPWM2SetDuty"/> -<tocitem target="AVRPWM2Setup" text="AVRPWM2Setup"/> -<tocitem target="AVRReadADC" text="AVRReadADC"/> -<tocitem target="AVRSleep" text="AVRSleep"/> -<tocitem target="AVRTimerSetup" text="AVRTimerSetup"/> -<tocitem target="AVRUARTReceive" text="AVRUARTReceive"/> -<tocitem target="AVRUARTSetup" text="AVRUARTSetup"/> -<tocitem target="AVRUARTTransmit" text="AVRUARTTransmit"/> -<tocitem target="CV_AdaptiveThreshold" text="CV_AdaptiveThreshold"/> -<tocitem target="CV_Blur" text="CV_Blur"/> -<tocitem target="CV_Canny" text="CV_Canny"/> -<tocitem target="CV_CornerHarris" text="CV_CornerHarris"/> -<tocitem target="CV_CreateImage" text="CV_CreateImage"/> -<tocitem target="CV_CvtColor" text="CV_CvtColor"/> -<tocitem target="CV_Dilate" text="CV_Dilate"/> -<tocitem target="CV_DistanceTransform" text="CV_DistanceTransform"/> -<tocitem target="CV_Erode" text="CV_Erode"/> -<tocitem target="CV_GaussianBlur" text="CV_GaussianBlur"/> -<tocitem target="CV_GetImgSize" text="CV_GetImgSize"/> -<tocitem target="CV_LoadImage" text="CV_LoadImage"/> -<tocitem target="CV_MedianBlur" text="CV_MedianBlur"/> -<tocitem target="CV_SaveImage" text="CV_SaveImage"/> -<tocitem target="CV_ShowImage" text="CV_ShowImage"/> -<tocitem target="CV_Threshold" text="CV_Threshold"/> -<tocitem target="CV_WaitKey" text="CV_WaitKey"/> -</tocitem> -</tocitem> -</toc>
\ No newline at end of file diff --git a/includes/lapack.h b/includes/lapack.h index 5f12bc2..d3f6cb3 100644 --- a/includes/lapack.h +++ b/includes/lapack.h @@ -195,6 +195,13 @@ extern doubleComplex zgesvd_( char* , char* , int* , int* ,doubleComplex *,\ int* , double* ,doubleComplex* , int* ,doubleComplex* , int* ,\ doubleComplex* , int* , double* , int* ); +/*USed in QR decompsition*/ +extern double dgeqrf_(int *,int *,double *,int *,double *,double *,int *,int *); +extern double dgeqpf_(int *,int *,double *,int *,int *,double *,double *,int *); +extern double dorgqr_(int *,int *,int *,double *,int *,double *,double *,int *,int *); +extern void dlaset_(char *,int *,int *,double *,double *,double *,int *); + + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/includes/sci2clib.h b/includes/sci2clib.h index 78fb48b..b69f2a0 100644 --- a/includes/sci2clib.h +++ b/includes/sci2clib.h @@ -80,6 +80,25 @@ extern "C" { #include "interp1.h" #include "int_interp1.h" +/* SPECIAL FUNCTIONS */ + +/* interfacing erf */ +#include "erf.h" +#include "int_erf.h" + +/* interfacing erfc */ +#include "erfc.h" +#include "int_erfc.h" + +/* interfacing erfcx */ +#include "erfcx.h" +#include "int_erfcx.h" + +/* interfacing erfinv */ +#include "erfinv.h" +#include "int_erfinv.h" + + /* ELEMENTARY FUNCTIONS */ #include "nextpow2.h" @@ -160,6 +179,33 @@ extern "C" { /* interfacing fix */ #include "fix.h" #include "int_fix.h" +/*interfacing isrow*/ +#include "isrow.h" +#include "int_isrow.h" +/*interfacing nthroot*/ +#include "nthroot.h" +#include "int_nthroot.h" +/*interfacing pmodulo*/ +#include "pmodulo.h" +#include "int_pmodulo.h" +/*interfacing nanmax*/ +#include "nanmax.h" +#include "int_nanmax.h" +/*interfacing issquare*/ +#include "issquare.h" +#include "int_issquare.h" +/*interfacing isscalar*/ +#include "isscalar.h" +#include "int_isscalar.h" +/*interfacing isvector*/ +#include "isvector.h" +#include "int_isvector.h" +/*interfacing iscolumn*/ +#include "iscolumn.h" +#include "int_iscolumn.h" +/*interfacing ismatrix*/ +#include "ismatrix.h" +#include "int_ismatrix.h" /* interfacing floor */ #include "floor.h" #include "int_floor.h" @@ -318,7 +364,7 @@ extern "C" { #include "int_secd.h" /*interfacing float*/ -#include "float.h" +#include "get_float.h" #include "int_float.h" /*interfacing factorial*/ @@ -341,6 +387,10 @@ extern "C" { #include "lcm.h" #include "int_lcm.h" +/*interfacing isequal*/ +#include "isequal.h" +#include "int_isequal.h" + /* IMPLICIT LISTS */ /* interfacing implicitList/OpColon */ @@ -430,6 +480,12 @@ extern "C" { /*interfacing cumsum*/ #include "int_cumsum.h" #include "cumsum.h" +/*interfacing matrix*/ +#include "int_matrix.h" +#include "matrix.h" +/*interfacing nnz*/ +#include "int_nnz.h" +#include "nnz.h" /*interfacing cumprod*/ #include "int_cumprod.h" #include "cumprod.h" @@ -449,6 +505,16 @@ extern "C" { #include "int_norm.h" #include "norm.h" +/*interface Toeplitz */ +#include "toeplitz.h" +#include "int_toeplitz.h" + + +/*interface Cross */ +#include "cross.h" +#include "int_cross.h" + + /* SIGNAL PROCESSING */ @@ -550,6 +616,12 @@ extern "C" { /* interfacing mean */ #include "mean.h" #include "int_mean.h" +/* interfacing median */ +#include "median.h" +#include "int_median.h" +/* interfacing mad */ +#include "mad.h" +#include "int_mad.h" /* interfacing stdevf */ #include "stdevf.h" #include "int_stdevf.h" @@ -660,8 +732,27 @@ extern "C" { #include "hess.h" /* Linear Algebra - Hess function */ #include "int_hess.h" -#include "sva.h" -#include "int_sva.h" /*Linear Algebra - SVA function */ +#include "sva.h" /* Linear Algebra - SVA function */ +#include "int_sva.h" + +#include "sqroot.h" /* Linear Algebra - Sqroot function */ +#include "int_sqroot.h" + +#include "givens.h" /* Linear Algebra - Givens Function */ +#include "int_givens.h" + +#include "householder.h" /* Linear Algebra - Householder function */ +#include "int_householder.h" + +#include "fullrf.h" /* Linear Algebra - Full rank factoziation */ +#include "int_fullrf.h" + +#include "rowcomp.h" /* Linear Algebra - row compression, range */ +#include "int_rowcomp.h" + + +#include "qr.h" /* Linear Algebra - QR decomposition */ +#include "int_qr.h" /*Functions related to opencv*/ /*#include "cvcore.hpp" diff --git a/jar/scilab_en_US_help.jar b/jar/scilab_en_US_help.jar Binary files differindex 0faf414..526697f 100644 --- a/jar/scilab_en_US_help.jar +++ b/jar/scilab_en_US_help.jar diff --git a/macros/ASTManagement/AST2Ccode.sci b/macros/ASTManagement/AST2Ccode.sci index 516291a..20aa999 100644 --- a/macros/ASTManagement/AST2Ccode.sci +++ b/macros/ASTManagement/AST2Ccode.sci @@ -43,6 +43,8 @@ load(FileInfo.SharedInfoDatFile,'SharedInfo'); nxtscifunname = SharedInfo.NextSCIFunName; nxtscifunnumber = SharedInfo.NextSCIFunNumber; ReportFileName = FileInfo.Funct(nxtscifunnumber).ReportFileName; +SharedInfo.Function_list = []; +SharedInfo.Function_list_index = 1; // --------------------------------- // --- Parameter Initialization. --- @@ -299,6 +301,22 @@ while ~meof(fidAST) AST_PushASTStack(treeline); end end +// ------------------------------------ +// -----List of functions Used-------- +// ------------------------------------- + +SharedInfo.Function_list_index = SharedInfo.Function_list_index - 2; +SharedInfo.Function_list = SharedInfo.Function_list(1:SharedInfo.Function_list_index); +//To remove function repeatedly used---------- +x = size(unique(SharedInfo.Function_list)); +SharedInfo.Function_list_index = x(1); +SharedInfo.Function_list = unique(SharedInfo.Function_list); + +SharedInfo.Function_list = SharedInfo.Function_list(1:SharedInfo.Function_list_index); + + + + // -------------------------------------- // --- End main loop to read the AST. --- // -------------------------------------- diff --git a/macros/ASTManagement/AST_HandleEndGenFun.sci b/macros/ASTManagement/AST_HandleEndGenFun.sci index 327dc29..79ec976 100644 --- a/macros/ASTManagement/AST_HandleEndGenFun.sci +++ b/macros/ASTManagement/AST_HandleEndGenFun.sci @@ -75,6 +75,10 @@ disp_isthere = 0; //NUT: verifica se ASTFunType e' veramente importante // #RNU_RES_E [ASTFunName,InArg,NInArg,OutArg,NOutArg] = AST_GetFuncallPrm(FileInfo,SharedInfo,ASTFunType); +if (ASTFunType=='Funcall') +SharedInfo.Function_list(SharedInfo.Function_list_index) = ASTFunName; +SharedInfo.Function_list_index = SharedInfo.Function_list_index + 1; +end NOutArg_mod = NOutArg if ASTFunName == 'OpLogAnd' AST_PushASTStack('&&'); @@ -128,8 +132,10 @@ NOutArg_mod = NOutArg PrintStringInfo(' ',ReportFileName,'both','y'); error(9999, 'SCI2CERROR: Unexpected number of output arguments for global function.'); end - elseif(ASTFunName == 'raspi' | ASTFunName == 'raspi_close') - SharedInfo.SkipNextFun = 1; + //To skip the functions for Raspberry Pi connections + elseif(ASTFunName == 'raspi' | ASTFunName == 'raspi_close' | ASTFunName == 'i2cdetect') + disp_isthere=1; // Skips the corresponding Lhs argument declaration + return // Skips the function call end // #RNU_RES_B @@ -143,8 +149,8 @@ NOutArg_mod = NOutArg if ASTFunName == '%sn' ASTFunName='modsn'; - end - + end + if (ASTFunName == 'OpEqual') FunTypeAnnot = ''; FunSizeAnnot = ''; diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci index 3b977bd..dbdae9d 100644 --- a/macros/CCodeGeneration/C_GenerateMakefile.sci +++ b/macros/CCodeGeneration/C_GenerateMakefile.sci @@ -70,7 +70,7 @@ else PrintStringInfo('CXX = arm-linux-gnueabihf-g++ ',FileInfo.MakefileFilename,'file','y','y'); PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y'); PrintStringInfo('CXXFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y'); - PrintStringInfo('LDFLAGS = -llapack -lrefblas -lgfortran -lwiringPi -lwiringPiDev -lrt -lpthread',FileInfo.MakefileFilename,'file','y','y'); + PrintStringInfo('LDFLAGS = -llapack -lrefblas -lgfortran -lwiringPi -lwiringPiDev -lrt -lpthread -lRPIwfi',FileInfo.MakefileFilename,'file','y','y'); else PrintStringInfo('CC = gcc',FileInfo.MakefileFilename,'file','y','y'); PrintStringInfo('CXX = g++',FileInfo.MakefileFilename,'file','y','y'); diff --git a/macros/CCodeGeneration/C_GenerateMkfle_arduino.sci b/macros/CCodeGeneration/C_GenerateMkfle_arduino.sci index b43eb44..8b890f9 100644 --- a/macros/CCodeGeneration/C_GenerateMkfle_arduino.sci +++ b/macros/CCodeGeneration/C_GenerateMkfle_arduino.sci @@ -1,3 +1,17 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE + +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Yash Pratap Singh Tomar +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + + + function C_GenerateMkfle_arduino(FileInfo,SharedInfo) PrintStringInfo('ARDUINO_DIR = /usr/share/arduino',FileInfo.MakefileFilename,'file','y','y'); diff --git a/macros/CCodeGeneration/GetClsFileName.sci b/macros/CCodeGeneration/GetClsFileName.sci index d92a431..4220410 100644 --- a/macros/CCodeGeneration/GetClsFileName.sci +++ b/macros/CCodeGeneration/GetClsFileName.sci @@ -78,7 +78,6 @@ elseif (SCI2Cfileexist(FileInfo.SCI2CLibSCIAnnFun,tmpannfilename)) SCI2CClassName = FL_GetFunctionClass(AnnFileName,SCI2CClassSpecifier,ReportFileName); SCI2CClassFileName = fullfile(FileInfo.SCI2CLibSCIAnnCls,SCI2CClassName+'.acls'); end - if (FlagFoundAnnFile == 0) [FlagFoundAnnFile,fullpathscifilename] = SCI2CFindFile(FileInfo.UserSciFilesPaths,FunName+'.sci'); if (FlagFoundAnnFile == 0) diff --git a/macros/Hardware/RasberryPi/Digital/RPI_digitalRead.sci b/macros/Hardware/RasberryPi/Digital/RPI_digitalRead.sci new file mode 100755 index 0000000..f3f229f --- /dev/null +++ b/macros/Hardware/RasberryPi/Digital/RPI_digitalRead.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_digitalRead(pin) +// Function to read the digital voltage at the given pin +// +// Calling Sequence +// v=RPI_digitalRead(pin) +// +// Parameters +// pin: The pin number to read the voltage from. Numbering sequence to be followed as initiated using RPI_pinNumbering function. +// +// Description +// This funtion reads the digital voltage at the given pin. Returns a 0 (for low) and 1 (for high). +// Note: pin should be set for input mode using RPI_pinMode. The function will also return 0/1 corresponding to what the voltage is set for an output pin. +// +// Examples +// v=RPI_digitalRead(0) +// See also +// RPI_analogWrite, RPI_analogRead, RPI_digitalWrite, RPI_pinNumbering, RPI_pinMode +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="diR#1#"+string(pin)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Digital/RPI_digitalReadByte.sci b/macros/Hardware/RasberryPi/Digital/RPI_digitalReadByte.sci new file mode 100755 index 0000000..5cbccc2 --- /dev/null +++ b/macros/Hardware/RasberryPi/Digital/RPI_digitalReadByte.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_digitalReadByte() +// Function to read first 8 GPIO pins +// +// Calling Sequence +// b=RPI_digitalReadByte() +// +// Description +// This function read the state of the first eight GPIO pins at once. The state is read from pin0 to pin7. +// +// Note: The MSB-LSB sequence here is opposite of that of the RPI_digitalWriteByte. +// +// Examples +// b=RPI_digitalReadByte() +// See also +// RPI_digitalWriteByte, RPI_digitalRead +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="BtR#0#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Digital/RPI_digitalWrite.sci b/macros/Hardware/RasberryPi/Digital/RPI_digitalWrite.sci new file mode 100755 index 0000000..d4ac660 --- /dev/null +++ b/macros/Hardware/RasberryPi/Digital/RPI_digitalWrite.sci @@ -0,0 +1,46 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_digitalWrite(pin,Volt) +// Function to set digital voltage at the given pin +// +// Calling Sequence +// RPI_digitalWrite(pin,Volt) +// +// Parameters +// pin : The pin number to set the voltage at. Numbering sequence to be followed as initiated using RPI_pinNumbering function. +// Volt: Digital voltage to set. 0 (for logic-LOW) or 1 (for logic-HIGH) +// +// Description +// This funtion sets the voltage at the given pin. 0v for logic 0 and 3.3v for logic 1. +// Note: pin should be set for output mode using RPI_pinMode. +// +// Examples +// RPI_digitalWrite(0,1) +// See also +// RPI_analogWrite, RPI_digitalRead, RPI_digitalRead, RPI_pinNumbering, RPI_pinMode +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + if (Volt==0 | Volt==1) then + commande="diW#2#"+string(pin)+"#"+string(Volt)+"#"; + else + error("Voltage logic should be 0 or 1."); + end + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Digital/RPI_digitalWriteByte.sci b/macros/Hardware/RasberryPi/Digital/RPI_digitalWriteByte.sci new file mode 100755 index 0000000..f7f9191 --- /dev/null +++ b/macros/Hardware/RasberryPi/Digital/RPI_digitalWriteByte.sci @@ -0,0 +1,42 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_digitalWriteByte(Byte) +// Function to set first eight GPIO pins to a particular value +// +// Calling Sequence +// RPI_digitalWriteByte(Byte) +// +// Parameters +// Byte: An 8-bit byte to write on the first 8 GPIO pins. Inter from 0 to 255. +// +// Description +// This writes the 8-bit byte supplied to the first 8 GPIO pins. It’s the fastest way to set all 8 bits at once to a particular value, although it still takes two write operations to the Pi’s GPIO hardware. The state is written from pin7 to pin0. +// +// Note: The MSB-LSB sequence here is opposite to that from RPI_digitalReadByte. +// +// Examples +// RPI_digitalWriteByte(128) +// See also +// RPI_digitalReadByte, RPI_digitalWrite +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="BtW#1#"+string(Byte)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Digital/buildmacros.sce b/macros/Hardware/RasberryPi/Digital/buildmacros.sce new file mode 100755 index 0000000..7d533f7 --- /dev/null +++ b/macros/Hardware/RasberryPi/Digital/buildmacros.sce @@ -0,0 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/Hardware/RasberryPi/Digital/names b/macros/Hardware/RasberryPi/Digital/names new file mode 100755 index 0000000..27fe63b --- /dev/null +++ b/macros/Hardware/RasberryPi/Digital/names @@ -0,0 +1,4 @@ +RPI_digitalRead +RPI_digitalReadByte +RPI_digitalWrite +RPI_digitalWriteByte diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CRead.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CRead.sci new file mode 100755 index 0000000..afd9850 --- /dev/null +++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CRead.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_I2CRead(fd) +// Function to read device +// +// Calling Sequence +// RPI_I2CRead(fd) +// +// Parameters +// fd: file descriptor obtained from RPI_I2CSetup +// +// Description +// Function for a simple device read. Some devices present data when you read them without having to do any register transactions. +// +// Examples +// RPI_I2CRead(13) +// See also +// RPI_i2cdetect, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CWriteReg16, RPI_I2CSetupInterface, RPI_I2CSetup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="CR1#1#"+string(fd)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg16.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg16.sci new file mode 100755 index 0000000..f0ad989 --- /dev/null +++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg16.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_I2CReadReg16(fd,reg) +// Function to read 16-bit valu from the register +// +// Calling Sequence +// RPI_I2CReadReg16(fd,reg) +// +// Parameters +// fd : file descriptor obtained from RPI_I2CSetup +// reg: integer register to read data from +// +// Description +// This function reads a 16-bit value from the device register indicated. +// +// Examples +// RPI_I2CReadReg16(13,0x40) +// See also +// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg8, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CWriteReg16, RPI_I2CSetupInterface, RPI_I2CSetup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="CR3#2#"+string(fd)+"#"+string(reg)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg8.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg8.sci new file mode 100755 index 0000000..d2ab59f --- /dev/null +++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg8.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_I2CReadReg8(fd,reg) +// Function to read 8-bit valu from the register +// +// Calling Sequence +// RPI_I2CReadReg8(fd,reg) +// +// Parameters +// fd : file descriptor obtained from RPI_I2CSetup +// reg: integer register to read data from +// +// Description +// This function reads an 8-bit value from the device register indicated. +// +// Examples +// RPI_I2CReadReg8(13,0x40) +// See also +// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg16, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CWriteReg16, RPI_I2CSetupInterface, RPI_I2CSetup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="CR2#2#"+string(fd)+"#"+string(reg)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CSetup.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CSetup.sci new file mode 100755 index 0000000..801c2e6 --- /dev/null +++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CSetup.sci @@ -0,0 +1,42 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_I2CSetup(addr) +// Function to initialize the I2C system +// +// Calling Sequence +// fd=RPI_I2CSetup(addr) +// +// Parameters +// addr: integer, the I2C number of the device obtained using RPI_i2cdetect +// +// Description +// This initialises the I2C system with your given device identifier. The addr is the I2C number of the device and obtained using RPI_i2cdetect program. The function works out the Raspberry Pi revision and opens the appropriate device in /dev. +// +//The return value is the standard Linux filehandle, or -1 if any error – in which case, errno can be consulted as usual. +// +// Examples +// fd=RPI_I2CSetup(64) +// See also +// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CWriteReg16, RPI_I2CSetupInterface +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="CSe#1#"+string(addr)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CSetupInterface.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CSetupInterface.sci new file mode 100755 index 0000000..fed4f05 --- /dev/null +++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CSetupInterface.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_I2CSetupInterface(device,addr) +// Function to select different I2C interfaces +// +// Calling Sequence +// I2CSetupInterface(device,addr) +// +// Parameters +// device: device +// addr : the I2C number of the device obtained using RPI_i2cdetect +// +// Description +// This feature is not implemented currently, and will be used to select different I2C interfaces if the RPi ever receives them. +// +// Examples +// I2CSetupInterface(1,0x48) +// See also +// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CWriteReg16, RPI_I2CSetup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="CSI#2#"+string(device)+"#"+string(addr)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CWrite.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CWrite.sci new file mode 100755 index 0000000..854b3b2 --- /dev/null +++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CWrite.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_I2CWrite(fd,data) +// Function to write to device +// +// Calling Sequence +// RPI_I2CWrite(fd,data) +// +// Parameters +// fd : file descriptor obtained from RPI_I2CSetup +// data: integer data to write to device +// +// Description +// Function for simple device write. Some devices accept data this way without needing to access any internal registers. +// +// Examples +// RPI_I2CWrite(13,100) +// See also +// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CWriteReg8, RPI_I2CWriteReg16, RPI_I2CSetupInterface, RPI_I2CSetup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="CW1#2#"+string(fd)+"#"+string(data)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg16.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg16.sci new file mode 100755 index 0000000..b2e8fb6 --- /dev/null +++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg16.sci @@ -0,0 +1,42 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_I2CWriteReg16(fd,reg,data) +// Function to write 16-bit data to register +// +// Calling Sequence +// RPI_I2CWriteReg16(fd,reg,data) +// +// Parameters +// fd : file descriptor obtained from RPI_I2CSetup +// reg : integer register to write data at +// data: integer data to write to device +// +// Description +// This function writes a 16-bit data value into the device register indicated. +// +// Examples +// RPI_I2CWriteReg16(13,0x40,100) +// See also +// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CSetupInterface, RPI_I2CSetup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="CW3#3#"+string(fd)+"#"+string(reg)+"#"+string(data)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg8.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg8.sci new file mode 100755 index 0000000..19c8157 --- /dev/null +++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg8.sci @@ -0,0 +1,42 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_I2CWriteReg8(fd,reg,data) +// Function to write 8-bit data to register +// +// Calling Sequence +// RPI_I2CWriteReg8(fd,reg,data) +// +// Parameters +// fd : file descriptor obtained from RPI_I2CSetup +// reg : integer register to write data at +// data: integer data to write to device +// +// Description +// This function writes an 8-bit data value into the device register indicated. +// +// Examples +// RPI_I2CWriteReg8(13,0x40,100) +// See also +// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CWrite, RPI_I2CWriteReg16, RPI_I2CSetupInterface, RPI_I2CSetup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="CW2#3#"+string(fd)+"#"+string(reg)+"#"+string(data)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/I2C/RPI_i2cdetect.sci b/macros/Hardware/RasberryPi/I2C/RPI_i2cdetect.sci new file mode 100755 index 0000000..a37bc4c --- /dev/null +++ b/macros/Hardware/RasberryPi/I2C/RPI_i2cdetect.sci @@ -0,0 +1,38 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_i2cdetect() +// Function to get the address of attached i2c device +// +// Calling Sequence +// RPI_i2cdetect() +// +// Description +// This function returns the address of the i2c device connected to the Raspberry pi. +// +// Examples +// addr=RPI_i2cdetect() +// See also +// RPI_I2CRead, RPI_I2CSetup, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CSetupInterface, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CWriteReg16 +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + rev=RPI_boardRev(); + commande="i2c#1#i2cdetect -y "+string(strtod(rev)-1)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/I2C/buildmacros.sce b/macros/Hardware/RasberryPi/I2C/buildmacros.sce new file mode 100755 index 0000000..7d533f7 --- /dev/null +++ b/macros/Hardware/RasberryPi/I2C/buildmacros.sce @@ -0,0 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/Hardware/RasberryPi/I2C/names b/macros/Hardware/RasberryPi/I2C/names new file mode 100755 index 0000000..5a31886 --- /dev/null +++ b/macros/Hardware/RasberryPi/I2C/names @@ -0,0 +1,9 @@ +RPI_I2CRead +RPI_I2CReadReg16 +RPI_I2CReadReg8 +RPI_I2CSetup +RPI_I2CSetupInterface +RPI_I2CWrite +RPI_I2CWriteReg16 +RPI_I2CWriteReg8 +RPI_i2cdetect diff --git a/macros/Hardware/RasberryPi/Interrupt/RPI_waitForInterrupt.sci b/macros/Hardware/RasberryPi/Interrupt/RPI_waitForInterrupt.sci new file mode 100755 index 0000000..bb18042 --- /dev/null +++ b/macros/Hardware/RasberryPi/Interrupt/RPI_waitForInterrupt.sci @@ -0,0 +1,45 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_waitForInterrupt(pin,timeOut) +// Function to set a pin to wait for interrupt. +// +// Calling Sequence +// i=RPI_waitForInterrupt(pin,timeOut) +// +// Parameters +// pin : The pin to check for interrupt. Numbering sequence to be followed as initiated using RPI_pinNumbering function. +// timeOut: The time (in milliseconds) for which to wait for interrupt. -1 to wait forever. +// +// Description +// When called, it will wait for an interrupt event to happen on that pin and the program will be stalled. The return value is -1 if an error occurred (and errno will be set appropriately), 0 if it timed out, or 1 on a successful interrupt event. +// +// Before using RPI_waitForInterrupt, first initialise the GPIO pin and at present the only way to do this is to use the gpio program, either in a script, or using the system() call from inside the program. +// Eg: To wait for a falling-edge interrupt on GPIO pin 0, setup the hardware using (before running the program): +// gpio edge 0 falling +// +// Examples +// i=RPI_waitForInterrupt(0,5000) +// See also +// +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="Int#2#"+string(pin)+"#"+string(timeOut)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Interrupt/buildmacros.sce b/macros/Hardware/RasberryPi/Interrupt/buildmacros.sce new file mode 100755 index 0000000..7d533f7 --- /dev/null +++ b/macros/Hardware/RasberryPi/Interrupt/buildmacros.sce @@ -0,0 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/Hardware/RasberryPi/Interrupt/names b/macros/Hardware/RasberryPi/Interrupt/names new file mode 100755 index 0000000..248c3e2 --- /dev/null +++ b/macros/Hardware/RasberryPi/Interrupt/names @@ -0,0 +1 @@ +RPI_waitForInterrupt diff --git a/macros/Hardware/RasberryPi/Misc/RPI_boardRev.sci b/macros/Hardware/RasberryPi/Misc/RPI_boardRev.sci new file mode 100755 index 0000000..91ddb33 --- /dev/null +++ b/macros/Hardware/RasberryPi/Misc/RPI_boardRev.sci @@ -0,0 +1,34 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_boardRev() +// Function to print the board revision. +// +// Calling Sequence +// rev=RPI_boardRev() +// +// Description +// This function returns the board revision of the Raspberry Pi. Returns either 1 or 2. +// +// Examples +// rev=RPI_boardRev() +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="bRv#0#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Misc/RPI_padDrive.sci b/macros/Hardware/RasberryPi/Misc/RPI_padDrive.sci new file mode 100755 index 0000000..f2d0b17 --- /dev/null +++ b/macros/Hardware/RasberryPi/Misc/RPI_padDrive.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_padDrive(Group,value) +// Function to set the 'strength' of the pad drivers for a particular group of pins +// +// Calling Sequence +// RPI_padDrive(Group,value) +// +// Parameters +// Group: the group to act on, a number from 0 to 2 +// Value: the strength, from 0 to 7, to set for the group +// +// Description +// This sets the “strength†of the pad drivers for a particular group of pins. There are 3 groups of pins and the drive strength is from 0 to 7. Do not use this unless you know what you are doing +// +// Examples +// RPI_padDrive(0,5) +// See also +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="pDr#2#"+string(Group)+"#"+string(value)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Misc/RPI_sn3218Setup.sci b/macros/Hardware/RasberryPi/Misc/RPI_sn3218Setup.sci new file mode 100755 index 0000000..0791c50 --- /dev/null +++ b/macros/Hardware/RasberryPi/Misc/RPI_sn3218Setup.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_sn3218Setup(pinBase) +// Function for setting up SN3218 I2C based LED controller. +// +// Calling Sequence +// RPI_sn3218Setup(pinBase) +// +// Parameters +// pinBase: any number above 64. The consecutive 18 pins will be allocated alongwith. +// +// Description +// This function sets up the extension module for the SN3218 I2C based LED controller.There is no I2C device address passed into the setup function – the SN3218 has a fixed I2C address of 0x54, so there’s no need to refer to it other than internally inside the driver. This also means that only one device can be connected to a Raspberry Pi. +// +// Examples +// RPI_sn3218Setup(67) +// See also +// RPI_sr595Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23008Setup, RPI_mcp23016Setup, RPI_mcp23017Setup, RPI_mcp23s08Setup, RPI_mcp23s17Setup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="sn3#1#"+string(pinBase)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Misc/buildmacros.sce b/macros/Hardware/RasberryPi/Misc/buildmacros.sce new file mode 100755 index 0000000..7d533f7 --- /dev/null +++ b/macros/Hardware/RasberryPi/Misc/buildmacros.sce @@ -0,0 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/Hardware/RasberryPi/Misc/names b/macros/Hardware/RasberryPi/Misc/names new file mode 100755 index 0000000..35a4a42 --- /dev/null +++ b/macros/Hardware/RasberryPi/Misc/names @@ -0,0 +1,3 @@ +RPI_boardRev +RPI_padDrive +RPI_sn3218Setup diff --git a/macros/Hardware/RasberryPi/RPI_DelayMicro.sci b/macros/Hardware/RasberryPi/RPI_DelayMicro.sci deleted file mode 100644 index bbb0bb3..0000000 --- a/macros/Hardware/RasberryPi/RPI_DelayMicro.sci +++ /dev/null @@ -1,38 +0,0 @@ -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in - -function RPI_DelayMicro(time) -// Function to insert some delay in code execution. -// -// Calling Sequence -// RPI_DelayMicro(time) -// -// Parameters -// time: time(microseconds) for which execution is to be delayed -// -// Description -// this function can be used for insertig execution delays. 'time' should be -// specified in microseconds.'time' should be between (1-65536). -// Note: Delay inserted by this function is not accurate, but depedent on -// operating system, other running tasks etc. -// -// Examples -// RPI_DelayMilli(100) //This will delay the execution of next code by 100 ms. -// -// See also -// RPI_DelayMicro -// -// -// Authors -// Siddhesh Wani -// - -// This is curretly dummy function. It provides no functionality but is required -// for providing support for generating C code for RPi. - -endfunction diff --git a/macros/Hardware/RasberryPi/RPI_DelayMilli.sci b/macros/Hardware/RasberryPi/RPI_DelayMilli.sci deleted file mode 100644 index 13b7962..0000000 --- a/macros/Hardware/RasberryPi/RPI_DelayMilli.sci +++ /dev/null @@ -1,39 +0,0 @@ -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in - -function RPI_DelayMilli(time) -// Function to insert some delay in milli seconds in code execution. -// -// Calling Sequence -// RPI_DelayMilli(time) -// -// Parameters -// time: time(milliseconds) for which execution is to be delayed -// -// Description -// This function can be used for insertig execution delays. 'time' should be -// specified in milliseconds. If more resolution is required, use 'RPI_DelayMicro' -// for inserting delay in microseconds. -// Note: Delay inserted by this function is not accurate, but depedent on -// operating system, other running tasks etc. -// -// Examples -// RPI_DelayMilli(100) //This will delay the execution of next code by 100 ms. -// -// See also -// RPI_DelayMicro -// -// -// Authors -// Siddhesh Wani -// - -// This is curretly dummy function. It provides no functionality but is required -// for providing support for generating C code for RPi. - -endfunction diff --git a/macros/Hardware/RasberryPi/RPI_DigitalIn.sci b/macros/Hardware/RasberryPi/RPI_DigitalIn.sci deleted file mode 100644 index 781c49c..0000000 --- a/macros/Hardware/RasberryPi/RPI_DigitalIn.sci +++ /dev/null @@ -1,43 +0,0 @@ -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in - -function state = RPI_DigitalIn(pin) -// Function to read current state on digital pins. -// -// Calling Sequence -// state = RPI_DigitalIn(pin) -// -// Parameters -// pin : pin of RPi to be used -// state : current state of the pin (0 -> LOW, 1 -> HIGH) -// -// Description -// This fucntion is used for reading the current state on gpio pins of RPi. 'RPI_DigitalSetup' function must be called before this for setting up pin as input. 'pin' must be specified from list given. 'state' specifies the input state (0 -> Low, 1-> High) -// Examples -// RPI_DigitalIn(RPI_GPIO_P1_03) //Reads the state of pin 3 of header P1. -// -// See also -// RPI_DigitalSetup RPI_DigitalOut -// -// -// Authors -// Siddhesh Wani -// -// ----------------------------------------------------------------- -//Pins of header P1 which can be used as GPIO -supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,... - 31,31,33,35,36,37,38,40]; - -PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO - -//If given pin does not support GPIO functionality, raise the error -if(PinIsGPIO == 0) - error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.'); -end -state = 1; -endfunction diff --git a/macros/Hardware/RasberryPi/RPI_DigitalOut.sci b/macros/Hardware/RasberryPi/RPI_DigitalOut.sci deleted file mode 100644 index dde3c93..0000000 --- a/macros/Hardware/RasberryPi/RPI_DigitalOut.sci +++ /dev/null @@ -1,44 +0,0 @@ -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in - -function RPI_DigitalOut(pin, state) -// Function to output desired state on digital pins. -// -// Calling Sequence -// RPI_DigitalOut(pin, state) -// -// Parameters -// pin : pin of RPi to be used -// state : desired state of the pin (0 -> LOW, 1 -> HIGH) -// -// Description -// This fucntion is used for outputting the desired state on gpio pins of RPi. 'RPI_DigitalSetup' function must be called before this for setting up pin as output. 'pin' must be specified from list given. 'state' specifies the output state (0 -> Low, 1-> High) -// Examples -// RPI_DigitalOut(RPI_GPIO_P1_03,0) //Changes the state of pin 3 of header P1 as 'Low'. -// -// See also -// RPI_DigitalSetup RPI_DigitalIn -// -// -// Authors -// Siddhesh Wani -// -// ----------------------------------------------------------------- -//Pins of header P1 which can be used as GPIO -supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,... - 31,31,33,35,36,37,38,40]; - -PinIsGPIO = members(pin, supported_pins); //Check if output pin supports GPIO - -//If given pin does not support GPIO functionality, raise the error -if(PinIsGPIO == 0) - error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.'); -end -state = 1; - -endfunction diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci b/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci deleted file mode 100644 index 01d6e07..0000000 --- a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci +++ /dev/null @@ -1,36 +0,0 @@ -function RPI_DigitalSetup(pin, direction) -// Function to setup digital pins. -// -// Calling Sequence -// RPI_DigitalSetup(pin,direction) -// -// Parameters -// pin : pin of RPi to be used -// direction : direction to be set for pin -// 0 -> INPUT, 1 -> OUTPUT, 2->PWM Output -// -// Description -// There are few pins available on RPi as Gpio or digital io. These pins can be used as digital output or input. Pin name must be provided from list provided. Please refer '' for complete list of pins. Direction can be 0 or 1 depending upon desired function (Input/output) -// Examples -// RPI_DigitalSetup(3,0) //Sets pin 3 of header P1 as input -// -// See also -// RPI_DigitalIn RPI_DigitalOut -// -// -// Authors -// Siddhesh Wani -// ----------------------------------------------------------------- -//Pins of header P1 which can be used as GPIO -supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,... - 31,31,33,35,36,37,38,40]; - -PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO - -//If given pin does not support GPIO functionality, raise the error -if(PinIsGPIO == 0) - error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.'); -end -state = 1; - -endfunction diff --git a/macros/Hardware/RasberryPi/RPI_GetMicros.sci b/macros/Hardware/RasberryPi/RPI_GetMicros.sci deleted file mode 100644 index 6c4db57..0000000 --- a/macros/Hardware/RasberryPi/RPI_GetMicros.sci +++ /dev/null @@ -1,39 +0,0 @@ -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in - -function Micros = RPI_GetMicros() -// Function to get time in Microsecond since first setup function called. -// -// Calling Sequence -// Micros = RPI_GetMicros() -// -// Parameters -// Micros: time in Microseconds since first setup function called -// -// Description -// This function can be used to get time since first setup function called. -// Note: To use this function atleast one setup function must be called. -// -// Examples -// start = RPI_GetMicros() -// RPI_DelayMicro(1000) //This will delay the execution of next code by 100 ms. -// end = RPI_GetMicros() -// delay = end- start //This should be approximately 1000 us. -// -// See also -// RPI_GetMillis RPI_DelayMilli RPI_DelayMicro -// -// -// Authors -// Siddhesh Wani -// - -// This is curretly dummy function. It provides no functionality but is required -// for providing support for generating C code for RPi. -Micros = 0; -endfunction diff --git a/macros/Hardware/RasberryPi/RPI_GetMillis.sci b/macros/Hardware/RasberryPi/RPI_GetMillis.sci deleted file mode 100644 index c034a70..0000000 --- a/macros/Hardware/RasberryPi/RPI_GetMillis.sci +++ /dev/null @@ -1,39 +0,0 @@ -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in - -function Millis = RPI_GetMillis() -// Function to get time in millisecond since first setup function called. -// -// Calling Sequence -// Millis = RPI_GetMillis() -// -// Parameters -// Millis: time in milliseconds since first setup function called -// -// Description -// This function can be used to get time since first setup function called. -// Note: To use this function atleast one setup function must be called. -// -// Examples -// start = RPI_GetMillis() -// RPI_DelayMilli(100) //This will delay the execution of next code by 100 ms. -// end = RPI_GetMillis() -// delay = end- start //This should be approximately 100ms. -// -// See also -// RPI_GetMicros RPI_DelayMilli RPI_DelayMicro -// -// -// Authors -// Siddhesh Wani -// - -// This is curretly dummy function. It provides no functionality but is required -// for providing support for generating C code for RPi. -Millis = 0; -endfunction diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci deleted file mode 100644 index 8448d36..0000000 --- a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci +++ /dev/null @@ -1,35 +0,0 @@ -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in - -function RPI_HardPWMSetClock(clock_divisor) -// Function to set PWM clock. PWM clock frequency is 19.2MHz, which can be reduced -// using suitable clock_divisor (1 to 2048, powers of 2) -// -// Calling Sequence -// RPI_HardPWMSetClock(clock_divisor) -// -// Parameters -// clock_divisor: Value can be from 1 to 2048, powers of 2. -// Description -// This function decides pwm clock. -// PWM frequency = (PWM Clock frequency/Clock divisor/range) -// PWM clock frequency = 19.2 MHz -// clock divisor is setup using RPI_HardPWMSetClock -// range is setup using RPI_HardPWMSetRange -// Examples -// -// See also -// RPI_HardPWMSetWrite RPI_HardPWMSetRange -// -// Authors -// Siddhesh Wani -// ----------------------------------------------------------------- - -// This is curretly dummy function. It provides no functionality but is required -// for providing support for generating C code for RPi. -endfunction diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci deleted file mode 100644 index 57b8260..0000000 --- a/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci +++ /dev/null @@ -1,32 +0,0 @@ -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in - -function RPI_HardPWMSetMode(pwm_mode) -// Function to set PWM mode. Two modes are available - balanced and mark/space -// -// Calling Sequence -// RPI_HardPWMSetMode(pwm_mode) -// -// Parameters -// pwm_mode: decides pwm mode -// 0 -> balanced -// 1 -> mark/space -// Description -// This function decides pwm mode -// Examples -// -// See also -// RPI_HardPWMSetWrite RPI_HardPWMSetRange -// -// Authors -// Siddhesh Wani -// ----------------------------------------------------------------- - -// This is curretly dummy function. It provides no functionality but is required -// for providing support for generating C code for RPi. -endfunction diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci deleted file mode 100644 index c2075e2..0000000 --- a/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci +++ /dev/null @@ -1,35 +0,0 @@ -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in - -function RPI_HardPWMSetRange(range_val) -// Function to set range value for PWM. Range value along with clock divisor -// decides pwm frequency. Range value must be less than 1024 -// -// Calling Sequence -// RPI_HardPWMSetRange(range_val) -// -// Parameters -// range_val: range for pwm -// Description -// This function decides range for pwm. -// PWM frequency = (PWM Clock frequency/Clock divisor/range) -// PWM clock frequency = 19.2 MHz -// clock divisor is setup using RPI_HardPWMSetClock -// range is setup using RPI_HardPWMSetRange -// Examples -// -// See also -// RPI_HardPWMSetClock RPI_HardPWMWrite -// -// Authors -// Siddhesh Wani -// ----------------------------------------------------------------- - -// This is curretly dummy function. It provides no functionality but is required -// for providing support for generating C code for RPi. -endfunction diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci deleted file mode 100644 index dba5e67..0000000 --- a/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci +++ /dev/null @@ -1,39 +0,0 @@ -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in - -function RPI_HardPWMWrite(pin,value) -// Function to change pwm duty on specified pin. Hardware PWM is available -// only on pin 12. So, only '12' should be provided as pin -// -// Calling Sequence -// RPI_HardPWMWrite(12,512) //Value must be smaller than the range set -// using RPI_HARDPWMSetRange -// -// Parameters -// pin: pin no on which pwm value is to be changed. Currently only 12 is allowed -// value: pwm value for given pin. This must be less than range value set -// Description -// This function changes pwm duty on specified pin. As for RPi, only one pin -// (pin 12) is available for hardware PWM. -// PWM frequency = (PWM Clock frequency/Clock divisor/range) -// PWM clock frequency = 19.2 MHz -// clock divisor is setup using RPI_HardPWMSetClock -// range is setup using RPI_HardPWMSetRange -// Actual PWM duty = value/range -// Examples -// -// See also -// RPI_HardPWMSetClock RPI_HardPWMSetRange -// -// Authors -// Siddhesh Wani -// ----------------------------------------------------------------- - -// This is curretly dummy function. It provides no functionality but is required -// for providing support for generating C code for RPi. -endfunction diff --git a/macros/Hardware/RasberryPi/RPI_PinISR.sci b/macros/Hardware/RasberryPi/RPI_PinISR.sci deleted file mode 100644 index c2354c1..0000000 --- a/macros/Hardware/RasberryPi/RPI_PinISR.sci +++ /dev/null @@ -1,56 +0,0 @@ -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in - -function RPI_PinISR(pin, edgetype, fn) -// Function to assign a function to be run when an interrupt occurs on -// specified pin. -// -// Calling Sequence -// RPI_PinISR(pin, edgetype, fn) -// -// Parameters -// pin : pin whose interrupt is to be configured -// edgetype: edge on which interrupt is to be monitored -// 1 -> Falling egde -// 2 -> Rising egde -// 3 -> Both egde -// fn: name of the function to be executed on interrupt occurance -// Description -// This functions monitors interrupt on specified pin for specified edge, -// When that interrupt occurs, function specified by 'fn' is executed. -// Examples -// RPI_PinISR(12, 0, Pin12ISR) //executes 'Pin12ISR' on falling edge on -// pin 12 -// See also -// RPI_ThreadCreate RPI_DigitalSetup -// -// -// Authors -// Siddhesh Wani -// ----------------------------------------------------------------- - -// This is curretly dummy function. It provides no functionality but is required -// for providing support for generating C code for RPi. - -//Pins of header P1 which can be used as GPIO -supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,... - 31,31,33,35,36,37,38,40]; - -PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO - -//If given pin does not support GPIO functionality, raise the error -if(PinIsGPIO == 0) - error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.'); -end -EdgeTypeSupported = members(edgetype,[1 2 3]); - -if(EdgeTypeSupported == 0) - error(9999, 'SCI2CERROR: Given edgetype is incorrect. Please specify correct edgetype from [1,2,3]') -end - -endfunction diff --git a/macros/Hardware/RasberryPi/RPI_SerialClose.sci b/macros/Hardware/RasberryPi/RPI_SerialClose.sci deleted file mode 100644 index f27dd43..0000000 --- a/macros/Hardware/RasberryPi/RPI_SerialClose.sci +++ /dev/null @@ -1,33 +0,0 @@ -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in - -function RPI_SerialClose(fd) -// Function to close serial port specified by file descriptor. -// -// Calling Sequence -// RPI_SerialClose(fd) -// -// Parameters -// fd : file descriptor for opened port -// Description -// This functions closes the specified serial port -// Examples -// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0' -// RPI_SerialClose(serial1) -// See also -// RPI_SerialOpen RPI_SerialSendChar -// -// -// Authors -// Siddhesh Wani -// ----------------------------------------------------------------- - -// This is curretly dummy function. It provides no functionality but is required -// for providing support for generating C code for RPi. - -endfunction diff --git a/macros/Hardware/RasberryPi/RPI_SerialFlush.sci b/macros/Hardware/RasberryPi/RPI_SerialFlush.sci deleted file mode 100644 index 9bab386..0000000 --- a/macros/Hardware/RasberryPi/RPI_SerialFlush.sci +++ /dev/null @@ -1,34 +0,0 @@ -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in - -function data = RPI_SerialGetChar(fd) -// Function to read data from specified serial port -// -// Calling Sequence -// RPI_SerialGetCharfd) -// -// Parameters -// fd: file descriptor returned when serial port was opened -// Description -// This functions reads character form specified port. In case no -// character is available, -1 is returned after 10 sec. -// Examples -// serial = RPI_SetupSerial("/dev/ttyAMA0", 9600); -// RPI_SerialFlush(serial); -// bytes = RPI_SerialDataAvail(serial); -// -// See also -// RPI_SetupSerial RPI_SendData -// -// Authors -// Siddhesh Wani -// ----------------------------------------------------------------- - -// This is curretly dummy function. It provides no functionality but is required -// for providing support for generating C code for RPi. -endfunction diff --git a/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci b/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci deleted file mode 100644 index a26e5b9..0000000 --- a/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci +++ /dev/null @@ -1,36 +0,0 @@ -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in - -function data = RPI_SerialGetChar(fd) -// Function to read data from specified serial port -// -// Calling Sequence -// RPI_SerialGetChar(fd) -// -// Parameters -// fd: file descriptor returned when serial port was opened -// Description -// This functions reads character form specified port. In case no -// character is available, -1 is returned after 10 sec. -// Examples -// serial = RPI_SetupSerial("/dev/ttyAMA0", 9600); -// bytes = RPI_SerialDataAvail(serial); -// if(bytes>0) -// data = RPI_SerialGetChar(serial) //Reads single character -// end -// See also -// RPI_SetupSerial RPI_SendData -// -// Authors -// Siddhesh Wani -// ----------------------------------------------------------------- - -// This is curretly dummy function. It provides no functionality but is required -// for providing support for generating C code for RPi. -data = 0; -endfunction diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci b/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci deleted file mode 100644 index 769b21d..0000000 --- a/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci +++ /dev/null @@ -1,37 +0,0 @@ -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in - -function RPI_SerialSendChar(fd, data) -// Function to send 8-bit char through serial port. -// -// Calling Sequence -// RPI_SerialSendChar(fd, data) -// -// Parameters -// fd : file descriptor for opened port -// data: 8-bit character data to be sent -// Description -// This functions sends input 8-bit character data on specified serial port -// Examples -// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0' -// RPI_SerialSendChar(serial1, 'H'); -// RPI_SerialSendChar(serial1, 'i'); -// RPI_SerialClose(serial1); -// -// See also -// RPI_SerialOpen RPI_SerialClose -// -// -// Authors -// Siddhesh Wani -// ----------------------------------------------------------------- - -// This is curretly dummy function. It provides no functionality but is required -// for providing support for generating C code for RPi. - -endfunction diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendData.sci b/macros/Hardware/RasberryPi/RPI_SerialSendData.sci deleted file mode 100644 index c05852b..0000000 --- a/macros/Hardware/RasberryPi/RPI_SerialSendData.sci +++ /dev/null @@ -1,38 +0,0 @@ -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in - -function RPI_SerialSendData(fd, data) -// Function to send data through serial port. Data can be of any datatype and -// can be scalar or matrix -// -// Calling Sequence -// RPI_SerialSendData(fd, data) -// -// Parameters -// fd : file descriptor for opened port -// data: data to be sent -// Description -// This functions sends input data on specified serial port -// Examples -// A = [2 3; 4 5] -// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0' -// RPI_SerialSendData(serial1, A); -// RPI_SerialClose(serial1); -// -// See also -// RPI_SerialOpen RPI_SerialClose -// -// -// Authors -// Siddhesh Wani -// ----------------------------------------------------------------- - -// This is curretly dummy function. It provides no functionality but is required -// for providing support for generating C code for RPi. - -endfunction diff --git a/macros/Hardware/RasberryPi/RPI_SerialSetup.sci b/macros/Hardware/RasberryPi/RPI_SerialSetup.sci deleted file mode 100644 index 0f26661..0000000 --- a/macros/Hardware/RasberryPi/RPI_SerialSetup.sci +++ /dev/null @@ -1,36 +0,0 @@ -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in - -function fd = RPI_SerialSetup(port, baudrate) -// Function to setup serial port. -// -// Calling Sequence -// RPI_SerialSetup(port, baudrate) -// -// Parameters -// port : port of RPi to be used (eg. ) -// direction : direction to be set for pin (0 -> INPUT, 1 -> OUTPUT) -// fd : file descriptor for opened port, -1 for error -// Description -// This functions opens the specified serial port and returns file descriptor -// for the same -// Examples -// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0' -// -// See also -// RPI_SerialClose RPI_SerialSendChar -// -// -// Authors -// Siddhesh Wani -// ----------------------------------------------------------------- - -// This is curretly dummy function. It provides no functionality but is required -// for providing support for generating C code for RPi. -fd = 0; -endfunction diff --git a/macros/Hardware/RasberryPi/RPI_adress.sci b/macros/Hardware/RasberryPi/RPI_adress.sci new file mode 100755 index 0000000..4c9aa7f --- /dev/null +++ b/macros/Hardware/RasberryPi/RPI_adress.sci @@ -0,0 +1,34 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +global RPI_piAdress; +function RPI_adress(adress) + // Function for non-ssh connection to raspberry pi + // + // Calling Sequence + // RPI_adress(adress) + // + // Parameters + // address : Network address of the raspberry pi. Eg:192.168.137.214 + // + // Description + // This program is required for the functioning of the remaining toolbox if the server is manually run by the user. + // + // Examples + // RPI_adress('10.42.0.82') + // See also + // raspi,raspi_close + // + // Authors + // Jorawar Singh + + global RPI_piAdress; + RPI_piAdress=adress; +endfunction diff --git a/macros/Hardware/RasberryPi/SPI/RPI_SPIDataRW.sci b/macros/Hardware/RasberryPi/SPI/RPI_SPIDataRW.sci new file mode 100755 index 0000000..186e68f --- /dev/null +++ b/macros/Hardware/RasberryPi/SPI/RPI_SPIDataRW.sci @@ -0,0 +1,42 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_SPIDataRW(channel,data,len) +// Function to perform simultaneous read-write on SPI +// +// Calling Sequence +// RPI_SPIDataRW(channel,data,len) +// +// Parameters +// channel: channel number, 0 or 1 +// data : data to write as list of integers +// len : length of the data +// +// Description +// This performs a simultaneous write/read transaction over the selected SPI bus. Data that was in your buffer is overwritten by data returned from the SPI bus. +// +// Examples +// RPI_SPIDataRW(0,[13,58],2) +// See also +// RPI_SPISetup, RPI_SPISetupMode, RPI_SPIGetFd +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="SPD#3#"+string(channel)+"#"+string(data)+"#"+string(len)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/SPI/RPI_SPIGetFd.sci b/macros/Hardware/RasberryPi/SPI/RPI_SPIGetFd.sci new file mode 100755 index 0000000..43cfc09 --- /dev/null +++ b/macros/Hardware/RasberryPi/SPI/RPI_SPIGetFd.sci @@ -0,0 +1,39 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_SPIGetFd(channel) +// +// Calling Sequence +// RPI_SPIGetFd(channel) +// +// Parameters +// channel: channel number, 0 or 1 +// +// Description +// +// +// Examples +// RPI_SPIGetFd(1) +// See also +// RPI_SPIDataRW, RPI_SPISetup, RPI_SPISetupMode +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="SPG#1#"+string(channel)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/SPI/RPI_SPISetup.sci b/macros/Hardware/RasberryPi/SPI/RPI_SPISetup.sci new file mode 100755 index 0000000..5654cf9 --- /dev/null +++ b/macros/Hardware/RasberryPi/SPI/RPI_SPISetup.sci @@ -0,0 +1,43 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_SPISetup(channel,speed) +// Function to initialize SPI +// +// Calling Sequence +// RPI_SPISetup(channel,spped) +// +// Parameters +// channel: channel number, 0 or 1 +// speed : SPI clock speed in Hz +// +// Description +// This function initialises a channel (The Pi has 2 channels; 0 and 1). The speed parameter is an integer in the range 500,000 through 32,000,000 and represents the SPI clock speed in Hz. +// +//The returned value is the Linux file-descriptor for the device, or -1 on error. +// +// Examples +// RPI_SPISetup(1,500000) +// See also +// RPI_SPIDataRW, RPI_SPISetupMode, RPI_SPIGetFd +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="SPS#2#"+string(channel)+"#"+string(speed)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/SPI/RPI_SPISetupMode.sci b/macros/Hardware/RasberryPi/SPI/RPI_SPISetupMode.sci new file mode 100755 index 0000000..fec785a --- /dev/null +++ b/macros/Hardware/RasberryPi/SPI/RPI_SPISetupMode.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_SPISetupMode(channel,speed,Mode) +// Function to initialize SPI +// +// Calling Sequence +// RPI_SPISetupMode(channel,spped,Mode) +// +// Parameters +// channel: channel number, 0 or 1 +// speed : SPI clock speed in Hz +// Mode : integer, mode to set +// +// Description +// +// Examples +// RPI_SPISetupMode(1,500000,2) +// See also +// RPI_SPIDataRW, RPI_SPISetup, RPI_SPIGetFd +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="SPM#23#"+string(channel)+"#"+string(speed)+"#"+string(Mode)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/SPI/buildmacros.sce b/macros/Hardware/RasberryPi/SPI/buildmacros.sce new file mode 100755 index 0000000..7d533f7 --- /dev/null +++ b/macros/Hardware/RasberryPi/SPI/buildmacros.sce @@ -0,0 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/Hardware/RasberryPi/SPI/names b/macros/Hardware/RasberryPi/SPI/names new file mode 100755 index 0000000..6f458a7 --- /dev/null +++ b/macros/Hardware/RasberryPi/SPI/names @@ -0,0 +1,4 @@ +RPI_SPIDataRW +RPI_SPIGetFd +RPI_SPISetup +RPI_SPISetupMode diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialClose.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialClose.sci new file mode 100755 index 0000000..6f54b65 --- /dev/null +++ b/macros/Hardware/RasberryPi/Serial/RPI_serialClose.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_serialClose(fd) +// Function to close and open serial device +// +// Calling Sequence +// RPI_serialClose(fd) +// +// Parameters +// fd: file-descriptor obtained from RPI_serialOpen function +// +// Description +// This function closes the device identified by the file descriptor given. +// +// Examples +// RPI_serialClose(13) +// See also +// RPI_serialOpen, RPI_serialFlush, RPI_serialPutchar, RPI_serialPuts, RPI_serialPrintf, RPI_serialDataAvail, RPI_serialGetchar +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="sCl#1#"+string(fd)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialDataAvail.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialDataAvail.sci new file mode 100755 index 0000000..9421e5b --- /dev/null +++ b/macros/Hardware/RasberryPi/Serial/RPI_serialDataAvail.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_serialDataAvail(fd) +// Function to get number of readable character from the serial device +// +// Calling Sequence +// RPI_serialDataAvail(fd) +// +// Parameters +// fd: file-descriptor obtained from RPI_serialOpen function +// +// Description +// Returns the number of characters available for reading, or -1 for any error condition, in which case error number will be set appropriately. +// +// Examples +// RPI_serialDataAvail(13) +// See also +// RPI_serialOpen, RPI_serialClose, RPI_serialFlush, RPI_serialPutchar, RPI_serialPuts, RPI_serialPrintf, RPI_serialGetchar +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="sDA#1#"+string(fd)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialFlush.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialFlush.sci new file mode 100755 index 0000000..845f70b --- /dev/null +++ b/macros/Hardware/RasberryPi/Serial/RPI_serialFlush.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_serialFlush(fd) +// Function to discard all data to/from the serial device +// +// Calling Sequence +// RPI_serialFlush(fd) +// +// Parameters +// fd: file-descriptor obtained from RPI_serialOpen function +// +// Description +// This function discards all data received, or waiting to be send down the given device. +// +// Examples +// RPI_serialFlush(13) +// See also +// RPI_serialOpen, RPI_serialClose, RPI_serialPutchar, RPI_serialPuts, RPI_serialPrintf, RPI_serialDataAvail, RPI_serialGetchar +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="sFl#1#"+string(fd)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialGetchar.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialGetchar.sci new file mode 100755 index 0000000..327fe35 --- /dev/null +++ b/macros/Hardware/RasberryPi/Serial/RPI_serialGetchar.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_serialGetchar(fd) +// Function to get next character from serial device +// +// Calling Sequence +// RPI_serialGetchar(fd) +// +// Parameters +// fd: file-descriptor obtained from RPI_serialOpen function +// +// Description +// This function returns the next character available on the serial device. This call will block for up to 10 seconds if no data is available (when it will return -1). +// +// Examples +// RPI_serialGetchar(13) +// See also +// RPI_serialOpen, RPI_serialClose, RPI_serialFlush, RPI_serialPutchar, RPI_serialPuts, RPI_serialPrintf, RPI_serialDataAvail +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="sGc#1#"+string(fd)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialOpen.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialOpen.sci new file mode 100755 index 0000000..684a6f2 --- /dev/null +++ b/macros/Hardware/RasberryPi/Serial/RPI_serialOpen.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_serialOpen(device,baud) +// Function to initialize a serial device +// +// Calling Sequence +// RPI_serialOpen(device,baud) +// +// Parameters +// device: device to connect to +// baud : the baud rate for communication +// +// Description +// This function opens and initialises the serial device and sets the baud rate. It sets the port into “raw†mode (character at a time and no translations), and sets the read timeout to 10 seconds. The return value is the file descriptor or -1 for any error, in which case errno will be set as appropriate. +// +// Examples +// RPI_serialOpen("/dev/ttyAMA0", 9600) +// See also +// RPI_serialClose, RPI_serialFlush, RPI_serialPutchar, RPI_serialPuts, RPI_serialPrintf, RPI_serialDataAvail, RPI_serialGetchar +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="sOp#2#"+string(device)+"#"+string(baud)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialPrintf.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialPrintf.sci new file mode 100755 index 0000000..668a9ff --- /dev/null +++ b/macros/Hardware/RasberryPi/Serial/RPI_serialPrintf.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_serialPrintf(fd,msg) +// Function to print to serial device +// +// Calling Sequence +// RPI_serialPrintf(fd,msg) +// +// Parameters +// fd : file-descriptor obtained from RPI_serialOpen function +// msg: message to print +// +// Description +// This function emulates the system printf function to the serial device. +// +// Examples +// RPI_serialPrintf(13,'White Collar rocks') +// See also +// RPI_serialOpen, RPI_serialClose, RPI_serialFlush, RPI_serialPutchar, RPI_serialPuts, RPI_serialDataAvail, RPI_serialGetchar +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="sPf#2#"+string(fd)+"#"+string(msg)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialPutchar.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialPutchar.sci new file mode 100755 index 0000000..ceea556 --- /dev/null +++ b/macros/Hardware/RasberryPi/Serial/RPI_serialPutchar.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_serialPutchar(fd,character) +// Function to send a single byte to the serial device +// +// Calling Sequence +// RPI_serialPutchar(fd,character) +// +// Parameters +// fd : file-descriptor obtained from RPI_serialOpen function +// character: character to send to the serial device +// +// Description +// This function sends the single byte to the serial device identified by the given file descriptor. +// +// Examples +// RPI_serialPutchar(113,'s') +// See also +// RPI_serialOpen, RPI_serialClose, RPI_serialFlush, RPI_serialPuts, RPI_serialPrintf, RPI_serialDataAvail, RPI_serialGetchar +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="sPc#2#"+string(fd)+"#"+string(character)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialPuts.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialPuts.sci new file mode 100755 index 0000000..ecbbe05 --- /dev/null +++ b/macros/Hardware/RasberryPi/Serial/RPI_serialPuts.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_serialPuts(fd,s) +// Function to send a null-terminalted string +// +// Calling Sequence +// RPI_serialPuts(fd,s) +// +// Parameters +// fd: file-descriptor obtained from RPI_serialOpen function +// s : string to send +// +// Description +// Sends the nul-terminated string to the serial device identified by the given file descriptor. +// +// Examples +// RPI_serialPuts(13,'Believe it, Dattebayo!\0') +// See also +// RPI_serialOpen, RPI_serialClose, RPI_serialFlush, RPI_serialPutchar, RPI_serialPrintf, RPI_serialDataAvail, RPI_serialGetchar +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="sPs#2#"+string(fd)+"#"+string(s)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Serial/buildmacros.sce b/macros/Hardware/RasberryPi/Serial/buildmacros.sce new file mode 100755 index 0000000..7d533f7 --- /dev/null +++ b/macros/Hardware/RasberryPi/Serial/buildmacros.sce @@ -0,0 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/Hardware/RasberryPi/Serial/names b/macros/Hardware/RasberryPi/Serial/names new file mode 100755 index 0000000..a652727 --- /dev/null +++ b/macros/Hardware/RasberryPi/Serial/names @@ -0,0 +1,8 @@ +RPI_serialClose +RPI_serialDataAvail +RPI_serialFlush +RPI_serialGetchar +RPI_serialOpen +RPI_serialPrintf +RPI_serialPutchar +RPI_serialPuts diff --git a/macros/Hardware/RasberryPi/Setup/RPI_getAlt.sci b/macros/Hardware/RasberryPi/Setup/RPI_getAlt.sci new file mode 100755 index 0000000..ba3d204 --- /dev/null +++ b/macros/Hardware/RasberryPi/Setup/RPI_getAlt.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_getAlt(pin) +// Function to get the current mode of pin +// +// Calling Sequence +// s=RPI_getAlt(pin) +// +// Parameters +// pin: The pin number to read the voltage from. Numbering sequence to be followed as initiated using RPI_pinNumbering function. +// +// Description +// This function returns the current mode of the pin. Output will be 0 for INPUT, 1 for OUTPUT, 2 for PWM_OUT and 3 for CLOCK. +// +// Examples +// s=RPI_getAlt(0) +// See also +// RPI_pinNumbering, RPI_pinModeAlt +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="gAt#1#"+string(pin)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Setup/RPI_pinMode.sci b/macros/Hardware/RasberryPi/Setup/RPI_pinMode.sci new file mode 100755 index 0000000..b6f52e6 --- /dev/null +++ b/macros/Hardware/RasberryPi/Setup/RPI_pinMode.sci @@ -0,0 +1,60 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +function RPI_pinMode(pin,Mode) +// Function to set the mode of the given pin. +// +// Calling Sequence +// RPI_pinMode(pin,Mode) +// +// Parameters +// pin : The pin number to act on. Numbering sequence to be followed as initiated using RPI_pinNumbering function. +// Mode: The mode in which to set the pin. +// +// Description +// This function configures the Raspberry Pi's given pin to work as the given mode (input/output/pwm/clock). Not all functions are available to all the pins. +// +// Mode can take the following values- +// <itemizedlist> +// <listitem><para>'in' -> sets the pin as input</para></listitem> +// <listitem><para>'out' -> sets the pin as output</para></listitem> +// <listitem><para>'pwm' -> sets the pin to PWM output. Only wiringPi pin 1 (BCM_GPIO pin 18) supports this function.</para></listitem> +// <listitem><para>'clock' -> sets the pin to CLOCK output. Only wiringPi pin 7 (BCM_GPIO pin 4) supports this function.</para></listitem> +// </itemizedlist> +// +// Examples +// RPI_pinMode(0,'out') +// See also +// RPI_pinNumbering +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + if Mode=='in' then + commande="pnM#2#"+string(pin)+"#0#"; + elseif Mode=='out' then + commande="pnM#2#"+string(pin)+"#1#"; + elseif Mode=='pwm' then + commande="pnM#2#"+string(pin)+"#2#"; + elseif Mode=='clock' then + commande="pnM#2#"+string(pin)+"#3#"; + else + error("Mode should be one of ""in/out/pwm/clock/soft_pwm/soft_tone/pwm_tone""."); + end + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Setup/RPI_pinModeAlt.sci b/macros/Hardware/RasberryPi/Setup/RPI_pinModeAlt.sci new file mode 100755 index 0000000..dd0fa10 --- /dev/null +++ b/macros/Hardware/RasberryPi/Setup/RPI_pinModeAlt.sci @@ -0,0 +1,55 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_pinModeAlt(pin,ALTMode) +// Function to set the current mode of pin +// +// Calling Sequence +// RPI_pinModeAlt(pin,ALTMode) +// +// Parameters +// pin : The pin number to read the voltage from. Numbering sequence to be followed as initiated using RPI_pinNumbering function. +// ALTMode: integer, from 0 to 7 +// +// Description +// This function sets the mode of the pin to either of the general GPIO (also set through RPI_pinMode function) or the alternatives available (not accessible through RPI_pinMode function). +// +// ALTMode can take the following values: +// <itemizedlist> +// <listitem>0 : Input</listitem> +// <listitem>1 : Output</listitem> +// <listitem>2 : ALT5</listitem> +// <listitem>3 : ALT4</listitem> +// <listitem>4 : ALT0</listitem> +// <listitem>5 : ALT1</listitem> +// <listitem>6 : ALT2</listitem> +// <listitem>7 : ALT3</listitem> +// </itemizedlist> +// +//The list of Alternate functions of all the pins can be found on page 102 of the official documentation: https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2835/BCM2835-ARM-Peripherals.pdf +// +// Examples +// RPI_pinModeAlt(1,2) +// See also +// RPI_pinMode, RPI_pinNumbering, RPI_getAlt +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="pMA#2#"+string(pin)+"#"+string(ALTMode)+"#"; + if getos()=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Setup/RPI_pinNumbering.sci b/macros/Hardware/RasberryPi/Setup/RPI_pinNumbering.sci new file mode 100755 index 0000000..4716de8 --- /dev/null +++ b/macros/Hardware/RasberryPi/Setup/RPI_pinNumbering.sci @@ -0,0 +1,54 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_pinNumbering(pinSetup) +// Function to initialize wiringpi with the number sequence to be followed. +// +// Calling Sequence +// RPI_pinNumbering(pinSetup) +// +// Parameters +// pinSetup: The pin number sequence to follow +// +// Description +// This function must be called at the start of the program or the program will fail to work correctly. It tells the wiringpi which number sequence will be used to work on Raspberry Pi. Returns 0 if no errors encountered. Pin maps for the different pinSetups can be found at the link in bibliography. +// +// pinSetup can take the following values: +// <itemizedlist> +// <listitem>'wiringpi' -> This initialises wiringPi and assumes that the calling program is going to be using the wiringPi pin numbering scheme. This is a simplified numbering scheme which provides a mapping from virtual pin numbers to the real underlying Broadcom GPIO pin numbers.</listitem> +// <listitem>'GPIO' -> Same as above, however it allows the calling programs to use the Broadcom GPIO pin numbers directly with no re-mapping.</listitem> +// <listitem>'phys' -> Identical to above, however it allows the calling programs to use the physical pin numbers on the P1 connector only.</listitem> +// </itemizedlist> +// +// Examples +// RPI_pinNumbering('wiringpi') +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + if (pinSetup=='wiringpi') then + commande="pN0#0#"; + elseif (pinSetup=='GPIO') then + commande="pN1#0#"; + elseif (pinSetup=='sys') then + commande="pN2#0#"; + elseif (pinSetup=='phys') then + commande="pN3#0#"; + else + error("pinSetup should be one of wiringpi/GPIO/sys/phys"); + end + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Setup/RPI_pullControl.sci b/macros/Hardware/RasberryPi/Setup/RPI_pullControl.sci new file mode 100755 index 0000000..6354bf5 --- /dev/null +++ b/macros/Hardware/RasberryPi/Setup/RPI_pullControl.sci @@ -0,0 +1,60 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_pullControl(pin,RMode) +// Function to change the internal pull up/down resistor setting for a given pin. +// +// Calling Sequence +// RPI_pullControl(pin,RMode) +// +// Parameters +// pin : The pin number to act on. Numbering sequence to be followed as initiated using RPI_pinNumbering function. +// RMode: The mode for the internal resistance of the given pin. +// +// Description +// This sets the pull-up or pull-down resistor mode on the given pin, which should be set as an input using the PRI_pinMode function. The internal pull up/down +// resistors have a value of approximately 50KΩ on the Raspberry Pi. +// +// RMode can take values: +// <itemizedlist> +// <listitem>'up' -> pull to 3.3v</listitem> +// <listitem>'down'-> pull to ground</listitem> +// <listitem>'none'-> no pull up/down</listitem> +// </itemizedlist> +// +// This function has no effect on the Raspberry Pi’s GPIO pins when in sys mode, set using RPI_pinNumbering function. To activate a pull-up/pull-down, use the gpio +// program in a script before starting the program. +// +// Examples +// RPI_pullControl(0,'down') +// See also +// RPI_pinNumbering, RPI_pinMode +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + if RMode=='up' then + commande="plC#2#"+string(pin)+"#2#"; + elseif RMode=='down' then + commande="plC#2#"+string(pin)+"#1#"; + elseif RMode=='none' then + commande="plC#2#"+string(pin)+"#0#"; + else + error("mode should be one of up/down/none"); + end + if getos()=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Setup/buildmacros.sce b/macros/Hardware/RasberryPi/Setup/buildmacros.sce new file mode 100755 index 0000000..7d533f7 --- /dev/null +++ b/macros/Hardware/RasberryPi/Setup/buildmacros.sce @@ -0,0 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/Hardware/RasberryPi/Setup/names b/macros/Hardware/RasberryPi/Setup/names new file mode 100755 index 0000000..3895498 --- /dev/null +++ b/macros/Hardware/RasberryPi/Setup/names @@ -0,0 +1,5 @@ +RPI_getAlt +RPI_pinMode +RPI_pinModeAlt +RPI_pinNumbering +RPI_pullControl diff --git a/macros/Hardware/RasberryPi/Shift/RPI_shiftIn.sci b/macros/Hardware/RasberryPi/Shift/RPI_shiftIn.sci new file mode 100755 index 0000000..2bdb89b --- /dev/null +++ b/macros/Hardware/RasberryPi/Shift/RPI_shiftIn.sci @@ -0,0 +1,42 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_shiftIn(dpin,cpin,order) +// Function to shift 8-bit value appearing on dpin +// +// Calling Sequence +// RPI_shiftIn(dpin,cpin,order) +// +// Parameters +// dpin : datapin +// cpin : clockpin +// order: integer, 0 (LSB first) or 1 (MSB first) +// +// Description +// This shifts an 8-bit data value in with the data appearing on the dPin and the clock being sent out on the cPin. Order is either LSBFIRST or MSBFIRST. The data is sampled after the cPin goes high. (So cPin high, sample data, cPin low, repeat for 8 bits) The 8-bit value is returned by the function. +// +// Examples +// RPI_shiftIn(0,2,0) +// See also +// RPI_shiftOut +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="shI#3#"+string(dpin)+"#"+string(cpin)+"#"+string(order)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Shift/RPI_shiftOut.sci b/macros/Hardware/RasberryPi/Shift/RPI_shiftOut.sci new file mode 100755 index 0000000..c348560 --- /dev/null +++ b/macros/Hardware/RasberryPi/Shift/RPI_shiftOut.sci @@ -0,0 +1,43 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_shiftOut(dpin,cpin,order,val) +// Function to shift out 8-bit data with value=val +// +// Calling Sequence +// RPI_shiftOut(dpin,cpin,order,val) +// +// Parameters +// dpin : datapin +// cpin : clockpin +// order: integer, 0 (LSB first) or 1 (MSB first) +// val : integer, data to send +// +// Description +// The shifts an 8-bit data value val out with the data being sent out on dPin and the clock being sent out on the cPin. order is as above. Data is clocked out on the rising or falling edge – ie. dPin is set, then cPin is taken high then low – repeated for the 8 bits. +// +// Examples +// RPI_shiftOut(1,2,0,123) +// See also +// RPI_shiftIn +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="shO#4#"+string(dpin)+"#"+string(cpin)+"#"+string(order)+"#"+string(val)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Shift/RPI_sr595Setup.sci b/macros/Hardware/RasberryPi/Shift/RPI_sr595Setup.sci new file mode 100755 index 0000000..fb77f98 --- /dev/null +++ b/macros/Hardware/RasberryPi/Shift/RPI_sr595Setup.sci @@ -0,0 +1,44 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_sr595Setup(pinBase,numPins,dataPin,clockPin,latchPin) +// Function to setup sr5595 shift register chips +// +// Calling Sequence +// RPI_sr595Setup(pinBase,numPins,dataPin,clockPin,latchPin) +// +// Parameters +// pinBase : any number above 64. Consecutive number of numPins will be allocated alongwith. +// numPins : number of pins, can be 0-32, 8 pins per 74x595 +// dataPin : The Raspberry pin corresponding to the 74x595's data pin. Numbering sequence to be followed as initiated by RPI_pinNumbering function. +// clockPin: The Raspberry pin corresponding to the 74x595's clock pin. Numbering sequence to be followed as initiated by RPI_pinNumbering function. +// latchPin: The Raspberry pin corresponding to the 74x595's latch pin. Numbering sequence to be followed as initiated by RPI_pinNumbering function. +// +// Description +// This function sets up the extension module for the 74×595 shift register chips which can be used as general purpose output ports. Each instance can support up to 4 74×595’s daisy-chained together, giving a 32-bit output port using just 3 GPIO wires from the Raspberry Pi (or from any other GPIO expansion port connected to the Pi) One can have as many instances of these enabled in the system, provided there are 3 spare GPIO pins per instance. +// +// Examples +// RPI_sr595Setup(100,10,0,1,2) +// See also +// RPI_sn3218Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23008Setup, RPI_mcp23016Setup, RPI_mcp23017Setup, RPI_mcp23s08Setup, RPI_mcp23s17Setup, RPI_pinNumbering +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="sr5#5#"+string(pinBase)+"#"+string(numPins)+"#"+string(dataPin)+"#"+string(clockPin)+"#"+string(latchPin)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Shift/buildmacros.sce b/macros/Hardware/RasberryPi/Shift/buildmacros.sce new file mode 100755 index 0000000..7d533f7 --- /dev/null +++ b/macros/Hardware/RasberryPi/Shift/buildmacros.sce @@ -0,0 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/Hardware/RasberryPi/Shift/names b/macros/Hardware/RasberryPi/Shift/names new file mode 100755 index 0000000..3fc17b6 --- /dev/null +++ b/macros/Hardware/RasberryPi/Shift/names @@ -0,0 +1,3 @@ +RPI_shiftIn +RPI_shiftOut +RPI_sr595Setup diff --git a/macros/Hardware/RasberryPi/Soft/RPI_softPwmCreate.sci b/macros/Hardware/RasberryPi/Soft/RPI_softPwmCreate.sci new file mode 100755 index 0000000..b0161c2 --- /dev/null +++ b/macros/Hardware/RasberryPi/Soft/RPI_softPwmCreate.sci @@ -0,0 +1,44 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_softPwmCreate(pin,ival,pwmrange) +// Function to set up software pwm on a given pin +// +// Calling Sequence +// RPI_softPwmCreate(pin,ival,pwmrange) +// +// Parameters +// pin : pin to start software pwm on. Numbering sequence to follow as initiated using RPI_pinNumbering function +// ival : inital value +// pwmrange: range for the pwm +// +// Description +// This function creates a software controlled PWM pin. Any GPIO pin can be used. Using 100 for the range, the value can be anything from 0 (off) to 100 (fully on) for the given pin. +// +//The return value is 0 for success. Otherwise the global error number variable should be checked to see what went wrong. +// +// Examples +// RPI_softPwmCreate(1,25,250) +// See also +// RPI_softPwmStop, RPI_softPwmWrite, RPI_softToneCreate, RPI_softToneStop, RPI_softToneWrite, RPI_pinNumbering, RPI_softServoWrite, RIP_softServoSetup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="sPC#3#"+string(pin)+"#"+string(ival)+"#"+string(pwmrange)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Soft/RPI_softPwmStop.sci b/macros/Hardware/RasberryPi/Soft/RPI_softPwmStop.sci new file mode 100755 index 0000000..5a911c8 --- /dev/null +++ b/macros/Hardware/RasberryPi/Soft/RPI_softPwmStop.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_softPwmStop(pin) +// Function to stop the software pwm on the pin +// +// Calling Sequence +// RPI_softPwmStop(pin) +// +// Parameters +// pin: pin to stop. Numbering sequence to follow as initiated using RPI_pinNumbering +// +// Description +// This function stops the software pwm on the specified pin. +// +// Examples +// RPI_softPwmStop(1) +// See also +// RPI_softPwmWrite, RPI_softToneCreate, RPI_softToneStop, RPI_softToneWrite, RPI_softPwmCreate, RPI_pinNumbering, RPI_softServoWrite, RIP_softServoSetup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="sPS#1#"+string(pin)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Soft/RPI_softPwmWrite.sci b/macros/Hardware/RasberryPi/Soft/RPI_softPwmWrite.sci new file mode 100755 index 0000000..349923f --- /dev/null +++ b/macros/Hardware/RasberryPi/Soft/RPI_softPwmWrite.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_softPwmWrite(pin,value) +// Function to update the softpwm value on the pin +// +// Calling Sequence +// RPI_softPwmWrite(pin,value) +// +// Parameters +// pin : pin to act on, should be initialised using RPI_softPwmCreate. Numbering sequence follows from_RPI pinNumbering +// value: value to write +// +// Description +// This updates the PWM value on the given pin. The value is checked to be in-range and pins that haven’t previously been initialised via softPwmCreate will be silently ignored. +// +// Examples +// RPI_softPwmWrite(1,250) +// See also +// RPI_softPwmStop, RPI_softToneCreate, RPI_softToneStop, RPI_softToneWrite, RPI_softPwmCreate, RPI_pinNumbering, RPI_softServoWrite, RIP_softServoSetup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="sPW#2#"+string(pin)+"#"+string(value)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Soft/RPI_softToneCreate.sci b/macros/Hardware/RasberryPi/Soft/RPI_softToneCreate.sci new file mode 100755 index 0000000..06adf83 --- /dev/null +++ b/macros/Hardware/RasberryPi/Soft/RPI_softToneCreate.sci @@ -0,0 +1,43 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_softToneCreate(pin) +// Function to create a software controlled tone pin +// +// Calling Sequence +// RPI_softToneCreate(pin) +// +// Parameters +// pin: pin to create software tone on. Numbering sequence to be followed as initiated using RPI_pinNumbering +// +// Description +// This function creates a software controlled tone pin. Any GPIO pin can be used. Using 100 for the range, the value can be anything from 0 (off) to 100 (fully on) for the given pin. +// +//The return value is 0 for success. Otherwise the global error number variable should be checked to see what went wrong. +// +// +// Examples +// RPI_softToneCreate(1) +// See also +// RPI_softPwmStop, RPI_softPwmWrite, RPI_softToneStop, RPI_softToneWrite, RPI_softPwmCreate, RPI_pinNumbering, RPI_softServoWrite, RIP_softServoSetup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="sTC#1#"+string(pin)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Soft/RPI_softToneStop.sci b/macros/Hardware/RasberryPi/Soft/RPI_softToneStop.sci new file mode 100755 index 0000000..4ecc420 --- /dev/null +++ b/macros/Hardware/RasberryPi/Soft/RPI_softToneStop.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_softToneStop(pin) +// Function to stop the software tone on the pin +// +// Calling Sequence +// RPI_softToneStop(pin) +// +// Parameters +// pin: soft tone pin to stop. Numbering sequence to follow as initiated using RPI_pinNumbering +// +// Description +// This function stops the software tone on the specified pin. +// +// Examples +// RPI_softToneStop(1) +// See also +// RPI_softPwmStop, RPI_softPwmWrite, RPI_softToneCreate, RPI_softToneWrite, RPI_softPwmCreate, RPI_pinNumbering, RPI_softServoWrite, RIP_softServoSetup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="sTS#1#"+string(pin)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Soft/RPI_softToneWrite.sci b/macros/Hardware/RasberryPi/Soft/RPI_softToneWrite.sci new file mode 100755 index 0000000..ba070a8 --- /dev/null +++ b/macros/Hardware/RasberryPi/Soft/RPI_softToneWrite.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_softToneWrite(pin,freq) +// Function to update tone frquency on the soft tone pin +// +// Calling Sequence +// RPI_softToneWrite(pin,freq) +// +// Parameters +// pin : soft tone pin +// freq: frequency value to write +// +// Description +// This function updates the tone frequency value on the given pin. The tone will be played until you set the frequency to 0. +// +// Examples +// RPI_softToneWrite(1,200) +// See also +// RPI_softPwmStop, RPI_softPwmWrite, RPI_softToneCreate, RPI_softToneStop, RPI_softPwmCreate, RPI_softServoWrite, RIP_softServoSetup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="sTW#2#"+string(pin)+"#"+string(freq)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Soft/buildmacros.sce b/macros/Hardware/RasberryPi/Soft/buildmacros.sce new file mode 100755 index 0000000..7d533f7 --- /dev/null +++ b/macros/Hardware/RasberryPi/Soft/buildmacros.sce @@ -0,0 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/Hardware/RasberryPi/Soft/names b/macros/Hardware/RasberryPi/Soft/names new file mode 100755 index 0000000..da06cbb --- /dev/null +++ b/macros/Hardware/RasberryPi/Soft/names @@ -0,0 +1,6 @@ +RPI_softPwmCreate +RPI_softPwmStop +RPI_softPwmWrite +RPI_softToneCreate +RPI_softToneStop +RPI_softToneWrite diff --git a/macros/Hardware/RasberryPi/Timing/RPI_delay.sci b/macros/Hardware/RasberryPi/Timing/RPI_delay.sci new file mode 100755 index 0000000..bd868e8 --- /dev/null +++ b/macros/Hardware/RasberryPi/Timing/RPI_delay.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_delay(time) +// Function to introduce delay in milliseconds +// +// Calling Sequence +// RPI_delay(time) +// +// Parameters +// time: Time in milliseconds for which to pause the program execution. +// +// Description +// This causes program execution to pause for at least 'time' milliseconds. Due to the multi-tasking nature of Linux it could be longer. The maximum delay is an unsigned 32-bit integer or approximately 49 days. +// +// Examples +// RPI_delay(1000) +// See also +// RPI_delayMicro, RPI_micros, RPI_millis +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="deS#1#"+string(time)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Timing/RPI_delayMicro.sci b/macros/Hardware/RasberryPi/Timing/RPI_delayMicro.sci new file mode 100755 index 0000000..a1b5d59 --- /dev/null +++ b/macros/Hardware/RasberryPi/Timing/RPI_delayMicro.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_delayMicro(time) +// Function to introduce delay in microseconds +// +// Calling Sequence +// RPI_delayMicros(time) +// +// Parameters +// time: Time in microseconds for which to pause the program execution. +// +// Description +// This causes program execution to pause for at least 'time' microseconds. Due to the multi-tasking nature of Linux it could be longer. The maximum delay is an unsigned 32-bit integer or approximately 71 minutes. +// +// Examples +// RPI_delayMicro(1000) +// See also +// RPI_delay, RPI_micros, RPI_millis +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="deU#1#"+string(time)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Timing/RPI_micros.sci b/macros/Hardware/RasberryPi/Timing/RPI_micros.sci new file mode 100755 index 0000000..058a827 --- /dev/null +++ b/macros/Hardware/RasberryPi/Timing/RPI_micros.sci @@ -0,0 +1,37 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_micros() +// Function to display the number of microseconds since the call to RPI_pinNumbering function. +// +// Calling Sequence +// t=RPI_micros() +// +// Description +// This returns the time in milliseconds since the call to RPI_pinNumbering function. It returns an unsigned 32-bit integer which wraps after approximately 71 minutes. +// +// Examples +// t=RPI_micros() +// See also +// RPI_millis, RPI_delay, RPI_delayMicro +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="mic#0#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Timing/RPI_millis.sci b/macros/Hardware/RasberryPi/Timing/RPI_millis.sci new file mode 100755 index 0000000..baecddc --- /dev/null +++ b/macros/Hardware/RasberryPi/Timing/RPI_millis.sci @@ -0,0 +1,37 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_millis() +// Function to display the number of milliseconds since the call to RPI_pinNumbering function. +// +// Calling Sequence +// t=RPI_millis() +// +// Description +// This returns the time in microseconds since the call to RPI_pinNumbering function. It returns an unsigned 32-bit integer which wraps after 49 days. +// +// Examples +// t=RPI_millis() +// See also +// RPI_micros, RPI_delay, RPI_delayMicro +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="mil#0#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/Timing/buildmacros.sce b/macros/Hardware/RasberryPi/Timing/buildmacros.sce new file mode 100755 index 0000000..7d533f7 --- /dev/null +++ b/macros/Hardware/RasberryPi/Timing/buildmacros.sce @@ -0,0 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/Hardware/RasberryPi/Timing/names b/macros/Hardware/RasberryPi/Timing/names new file mode 100755 index 0000000..0b47b34 --- /dev/null +++ b/macros/Hardware/RasberryPi/Timing/names @@ -0,0 +1,4 @@ +RPI_delay +RPI_delayMicro +RPI_micros +RPI_millis diff --git a/macros/Hardware/RasberryPi/buildmacros.sce b/macros/Hardware/RasberryPi/buildmacros.sce index 2954a42..07b564e 100644..100755 --- a/macros/Hardware/RasberryPi/buildmacros.sce +++ b/macros/Hardware/RasberryPi/buildmacros.sce @@ -1,4 +1,49 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in -tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); +RPI_Directories = [ "Digital", ... + "gertBoard", ... + "I2C", ... + "Interrupt", ... + "lcd", ... + "lcd128x64", ... + "mcp", ... + "Misc", ... + "pcf", ... + "piGlow", ... + "pinMap", ... + "pwm", ... + "Serial", ... + "Setup", ... + "Shift", ... + "Soft", ... + "SPI", ... + "Timing"]; + +RPI_path_buildmacros = get_absolute_file_path("buildmacros.sce"); -clear tbx_build_macros; +for H=1:size(RPI_Directories,"*") + myfile = RPI_path_buildmacros + filesep() + RPI_Directories(H) + filesep() + "buildmacros.sce"; + if isfile(myfile) then + exec(myfile); + end +end + +clear RPI_path_buildmacros; + +function buildmacros() + macros_path = get_absolute_file_path("buildmacros.sce"); + tbx_build_macros(TOOLBOX_NAME, macros_path); + clear tbx_build_macros; +endfunction + +buildmacros(); +clear buildmacros; diff --git a/macros/Hardware/RasberryPi/cleanmacros.sce b/macros/Hardware/RasberryPi/cleanmacros.sce new file mode 100755 index 0000000..a6428b2 --- /dev/null +++ b/macros/Hardware/RasberryPi/cleanmacros.sce @@ -0,0 +1,20 @@ +// ==================================================================== +// This file is released under the 3-clause BSD license. See COPYING-BSD. +// ==================================================================== +function cleanmacros() + + libpath = get_absolute_file_path("cleanmacros.sce"); + + binfiles = ls(libpath+"/*.bin"); + for i = 1:size(binfiles,"*") + mdelete(binfiles(i)); + end + + mdelete(libpath+"/names"); + mdelete(libpath+"/lib"); +endfunction + +cleanmacros(); +clear cleanmacros; // remove cleanmacros on stack + +// ==================================================================== diff --git a/macros/Hardware/RasberryPi/gertBoard/RPI_analogRead.sci b/macros/Hardware/RasberryPi/gertBoard/RPI_analogRead.sci new file mode 100755 index 0000000..41bf877 --- /dev/null +++ b/macros/Hardware/RasberryPi/gertBoard/RPI_analogRead.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_analogRead(pin) +// Function to read the analog voltage at the given pin +// +// Calling Sequence +// v=RPI_analogRead(pin) +// +// Parameters +// pin: The pin number to read the voltage from. Numbering sequence to be followed as initiated using RPI_pinNumbering function. +// +// Description +// This function returns the value read on the supplied analog input pin. Additional analog modules need to be registered to enable this function for devices such as the Gertboard, quick2Wire analog board, etc. +// +// Examples +// v=RPI_analogRead(0) +// See also +// RPI_analogWrite, RPI_digitalRead, RPI_digitalWrite, RPI_pinNumbering, RPI_pinMode +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="anR#1#"+string(pin)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/gertBoard/RPI_analogWrite.sci b/macros/Hardware/RasberryPi/gertBoard/RPI_analogWrite.sci new file mode 100755 index 0000000..f7089f5 --- /dev/null +++ b/macros/Hardware/RasberryPi/gertBoard/RPI_analogWrite.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_analogWrite(pin,Volt) +// Function to set analog voltage at given analog pin. +// +// Calling Sequence +// RPI_analogWrite(pin,Volt) +// +// Parameters +// pin : The pin number to set the voltage at. Numbering sequence to be followed as initiated using RPI_pinNumbering function. +// Volt: The analog voltage value to set at the pin. +// +// Description +// This writes the given value to the supplied analog pin. Additional analog modules need to be registered to enable this function for devices such as the Gertboard. +// +// Examples +// RPI_analogWrite(0,100) +// See also +// RPI_analogRead, RPI_digitalRead, RPI_digitalWrite, RPI_pinNumbering, RPI_pinMode +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="anW#2#"+string(pin)+"#"+string(Volt)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogRead.sci b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogRead.sci new file mode 100755 index 0000000..ce7e870 --- /dev/null +++ b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogRead.sci @@ -0,0 +1,42 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_gertboardAnalogRead(pin) +// Function to read voltage from gertboard +// +// Calling Sequence +// RPI_gertboardAnalogRead(pin) +// +// Parameters +// pin:the pin to read the voltage from. Numbering follows the pinBase from RPI_gertboardSetup function. +// +// Description +// After initialinzing the pinBase using the RPI_gertboeardSetup function, reading channel pinBase + 0 reads the first analog input channel (pin DA0 on the Gertboard). Returns a value from 0 to 1023 representing the value on the supplied pin. +// +// Examples +// RPI_gertboardAnalogRead(101) +// See also +// RPI_gertboardAnalogSetup, RPI_gertboardAnalogWrite, RPI_gertboardSPISetup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ +// http://pi4j.com/apidocs/com/pi4j/wiringpi/Gertboard.html + + commande="gAR#1#"+string(pin)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction + diff --git a/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogSetup.sci b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogSetup.sci new file mode 100755 index 0000000..a834811 --- /dev/null +++ b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogSetup.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_gertboardAnalogSetup(pinBase) +// Function to setup the gertboard +// +// Calling Sequence +// RPI_getboardAnalogSetup(pinBase) +// +// Parameters +// pinBase:the base pin that the analog ports will appear as +// +// Description +// This function calls a setup routine that allocates 2 pins and overlays the analog to digital input pins with the digital to analog output pins. pinBase is the base pin that you want the analog ports to appear as. So reading channel pinBase + 0 reads the first analog input channel (pin DA0 on the Gertboard), and writing pinBase + 0 outputs to the first analog output channel. (Pin AD0) +// +// Examples +// RPI_getboardAnalogSetup(100) +// See also +// RPI_gertboardAnalogRead, RPI_gertboardAnalogWrite, RPI_gertboardSPISetup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ +// http://pi4j.com/apidocs/com/pi4j/wiringpi/Gertboard.html + + commande="gAS#1#"+string(pinBase)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogWrite.sci b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogWrite.sci new file mode 100755 index 0000000..3f8f9dd --- /dev/null +++ b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogWrite.sci @@ -0,0 +1,42 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_gertboardAnalogWrite(pin,value) +// Function to write voltage value to pins on gertboard +// +// Calling Sequence +// RPI_gertboardAnalogWrite(pin,value) +// +// Parameters +// pin : the pin to read the voltage from. Numbering follows the pinBase from RPI_gertboardSetup function. +// value: voltage value to write +// +// Description +// After initialinzing the pinBase using the RPI_gertboeardSetup function, writing pinBase + 0 outputs to the first analog output channel. (Pin AD0). +// +// Examples +// RPI_gertboardAnalogWrite(100,100) +// See also +// RPI_gertboardAnalogSetup, RPI_gertboardAnalogRead, RPI_gertboardSPISetup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ +// http://pi4j.com/apidocs/com/pi4j/wiringpi/Gertboard.html + + commande="gAW#2#"+string(pin)+"#"+string(value)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardSPISetup.sci b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardSPISetup.sci new file mode 100755 index 0000000..d4117b0 --- /dev/null +++ b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardSPISetup.sci @@ -0,0 +1,39 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_gertboardSPISetup() +// Function to initialize SPI bus communication with gertboard +// +// Calling Sequence +// RPI_gertboardSPIsetup() +// +// Description +// This function must be called to initialize the SPI bus to communicate with the Gertboards ADC and DAC chips. +// +// Examples +// RPI_gertboardSPISetup() +// See also +// RPI_gertboardAnalogSetup, RPI_gertboardAnalogRead, RPI_gertboardAnalogWrite +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ +// http://pi4j.com/apidocs/com/pi4j/wiringpi/Gertboard.html + + commande="gSS#0#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction + diff --git a/macros/Hardware/RasberryPi/gertBoard/buildmacros.sce b/macros/Hardware/RasberryPi/gertBoard/buildmacros.sce new file mode 100755 index 0000000..7d533f7 --- /dev/null +++ b/macros/Hardware/RasberryPi/gertBoard/buildmacros.sce @@ -0,0 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/Hardware/RasberryPi/gertBoard/names b/macros/Hardware/RasberryPi/gertBoard/names new file mode 100755 index 0000000..27a469a --- /dev/null +++ b/macros/Hardware/RasberryPi/gertBoard/names @@ -0,0 +1,6 @@ +RPI_analogRead +RPI_analogWrite +RPI_gertboardAnalogRead +RPI_gertboardAnalogSetup +RPI_gertboardAnalogWrite +RPI_gertboardSPISetup diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdCharDef.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdCharDef.sci new file mode 100755 index 0000000..905cca8 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdCharDef.sci @@ -0,0 +1,44 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdCharDef(fd,index,d0,d1,d2,d3,d4,d5,d6,d7) +// Function to redefine a user-definable character +// +// Calling Sequence +// RPI_lcdCharDef(fd,index,data) +// +// Parameters +// fd : file-descriptor obtained using RPI_lcdInit function +// index: which character to redefine (0 to 7) +// d0-d7: integers from 0 to 255 erpresenting the elements of the array to form the character +// +// Description +// This function re-define one of the 8 user-definable characters in the display. +// +// The data array is 8 bytes which represent the character from the top-line to the bottom line. Note that the characters are actually 5×8, so only the lower 5 bits are used. +// +// Examples +// RPI_lcdCharDef(13,0,0,0,0,31,31,31,31,0) +// See also +// RPI_lcdCursorBlink, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lCD#10#"+string(fd)+"#"+string(index)+"#"+string(d0)+"#"+string(d1)+"#"+string(d2)+"#"+string(d3)+"#"+string(d4)+"#"+string(d5)+"#"+string(d6)+"#"+string(d7)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdClear.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdClear.sci new file mode 100755 index 0000000..6da7212 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdClear.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdClear(fd) +// Function to clear the lcd screen +// +// Calling Sequence +// RPI_lcdClear(fd) +// +// Parameters +// fd: file-descriptor obtained using RPI_lcdInit function +// +// Description +// This function clears the lcd screen. +// +// Examples +// RPI_lcdClear(13) +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lCl#1#"+string(fd)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdCursor.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdCursor.sci new file mode 100755 index 0000000..98c5471 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdCursor.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdCursor(fd,state) +// Function to turn cursor on/off +// +// Calling Sequence +// RPI_lcdCursor(fd,state) +// +// Parameters +// fd : file-descriptor obtained using RPI_lcdInit function +// state: 0 (for off) or 1 (for on) +// +// Description +// This function sets the visibility of cursor. +// +// Examples +// RPI_lcdCursor(13,1) +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lCu#2#"+string(fd)+"#"+string(state)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdCursorBlink.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdCursorBlink.sci new file mode 100755 index 0000000..b16ebc5 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdCursorBlink.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdCursorBlink(fd,state) +// Function to turn cursor blinking on/off +// +// Calling Sequence +// RPI_lcdCursorBlink(fd,state) +// +// Parameters +// fd : file-descriptor obtained using RPI_lcdInit function +// state: 0 (for off) or 1 (for on) +// +// Description +// This function sets the blinking of cursor. +// +// Examples +// RPI_lcdCursorBlink(13,1) +// See also +// RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lCB#2#"+string(fd)+"#"+string(state)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdDisplay.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdDisplay.sci new file mode 100755 index 0000000..de50af6 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdDisplay.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdDisplay(fd,state) +// Function to turn display on/off +// +// Calling Sequence +// RPI_lcdDisplay(fd,state) +// +// Parameters +// fd : file-descriptor obtained using RPI_lcdInit function +// state: 0 (for off) or 1 (for on) +// +// Description +// This function turns the display 'on' or 'off'. +// +// Examples +// RPI_lcdDisplay(13,1) +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lDs#2#"+string(fd)+"#"+string(state)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdHome.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdHome.sci new file mode 100755 index 0000000..0c4507f --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdHome.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdHome(fd) +// Function to send cursor back to the starting point (home) +// +// Calling Sequence +// RPI_lcdHome(fd) +// +// Parameters +// fd: file-descriptor obtained using RPI_lcdInit function +// +// Description +// This function sends the cursor to the top left (row=0,col=0) position on the lcd screen. +// +// Examples +// RPI_lcdHome(13) +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lHo#1#"+string(fd)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdInit.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdInit.sci new file mode 100755 index 0000000..c5ddb1e --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdInit.sci @@ -0,0 +1,54 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_lcdInit(rows,cols,bits,rs,strb,d0,d1,d2,d3,d4,d5,d6,d7) +// Function to initialize lcd +// +// Calling Sequence +// RPI_lcdInit(rows,cols,bits,rs,strb,d0,d1,d2,d3,d4,d5,d6,d7) +// +// Parameters +// rows: numer of rows in lcd +// cols: numer of colums in lcd +// bits: number of bits wide on the interface (4 or 8) +// rs : pin number of display RS +// strb: pin number of strobe (E) +// d0 : pin number of data pin 1 +// d1 : pin number of data pin 2 +// d2 : pin number of data pin 3 +// d3 : pin number of data pin 4 +// d4 : pin number of data pin 5 +// d5 : pin number of data pin 6 +// d6 : pin number of data pin 7 +// d7 : pin number of data pin 8 +// +// Description +// This function initalizes an lcd display attaced to the Raspberry pi. The return value is the file-descriptor to be used for all subsequent calls to the lcd library when dealing with that LCD, or -1 to indicate a fault. (Usually incorrect parameters) +// +// The numberin sequence to be followed as initiated using RPI_pinNumbering +// +// Examples +// fd=RPI_lcdInit (2,16,8,11,10,0,1,2,3,4,5,6,7) ; +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand, RPI_pinNumbering +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lIn#13#"+string(rows)+"#"+string(cols)+"#"+string(bits)+"#"+string(rs)+"#"+string(strb)+"#"+string(d0)+"#"+string(d1)+"#"+string(d2)+"#"+string(d3)+"#"+string(d4)+"#"+string(d5)+"#"+string(d6)+"#"+string(d7)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdPosition.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdPosition.sci new file mode 100755 index 0000000..0f97832 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdPosition.sci @@ -0,0 +1,42 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdPosition(fd,col,row) +// Function to move the cursor +// +// Calling Sequence +// RPI_lcdPosition(fd,col,row) +// +// Parameters +// fd : file-descriptor obtained using RPI_lcdInit function +// col: column number to go to +// row: row number to go to +// +// Description +// This function set the position of the cursor for subsequent text entry. col=0 is the left-most edge any row=0 is the top line. +// +// Examples +// RPI_lcdPosition(13,0,1) +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lPo#3#"+string(fd)+"#"+string(col)+"#"+string(row)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdPrintf.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdPrintf.sci new file mode 100755 index 0000000..833bf44 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdPrintf.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdPrintf(fd,String) +// Function to print on the lcd screen +// +// Calling Sequence +// RPI_lcdPrintf(fd,String) +// +// Parameters +// fd : file-descriptor obtained using RPI_lcdInit function +// String: string to print on the screen +// +// Description +// This function outputs a single ASCII character, a string or a formatted string using the usual printf formatting commands. +// +// Examples +// RPI_lcdPrintf(13,'We live in the shadows to serve the light.') +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lPf#2#"+string(fd)+"#"+String+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdPutchar.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdPutchar.sci new file mode 100755 index 0000000..337691d --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdPutchar.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdPutchar(fd,character) +// Function to print on the lcd screen +// +// Calling Sequence +// RPI_lcdPutchar(fd,charcter) +// +// Parameters +// fd : file-descriptor obtained using RPI_lcdInit function +// charcter: integer, 0 to 255, character to print +// +// Description +// This function outputs a single ASCII character, a string or a formatted string using the usual printf formatting commands. +// +// Examples +// RPI_lcdPutchar(13,200) +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lPc#2#"+string(fd)+"#"+string(character)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdPuts.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdPuts.sci new file mode 100755 index 0000000..8584309 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdPuts.sci @@ -0,0 +1,42 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdPuts(fd,character) +// Function to print on the lcd screen +// +// Calling Sequence +// RPI_lcdPuts(fd,character) +// +// Parameters +// fd : file-descriptor obtained using RPI_lcdInit function +// character: character to print +// +// Description +// This function outputs a single ASCII character, a string or a formatted string using the usual printf formatting commands. +// +// Examples +// RPI_lcdPuts(13,'K') +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lPu#2#"+string(fd)+"#"+string(character)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction + diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdSendCommand.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdSendCommand.sci new file mode 100755 index 0000000..db677be --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdSendCommand.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdSendCommand(fd,command) +// Function to send command to lcd +// +// Calling Sequence +// RPI_lcdSendCommand(fd,command) +// +// Parameters +// fd : file-descriptor obtained using RPI_lcdInit function +// command: A command, binary, to submit to the LCD. +// +// Description +// This function sends any arbitrary command to the LCD. +// +// Examples +// RPI_lcdSendCommand(13,00) +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lSC#2#"+string(fd)+"#"+string(command)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd/buildmacros.sce b/macros/Hardware/RasberryPi/lcd/buildmacros.sce new file mode 100755 index 0000000..7d533f7 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd/buildmacros.sce @@ -0,0 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/Hardware/RasberryPi/lcd/names b/macros/Hardware/RasberryPi/lcd/names new file mode 100755 index 0000000..8f87ff8 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd/names @@ -0,0 +1,12 @@ +RPI_lcdCharDef +RPI_lcdClear +RPI_lcdCursor +RPI_lcdCursorBlink +RPI_lcdDisplay +RPI_lcdHome +RPI_lcdInit +RPI_lcdPosition +RPI_lcdPrintf +RPI_lcdPutchar +RPI_lcdPuts +RPI_lcdSendCommand diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64Orientation.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64Orientation.sci new file mode 100755 index 0000000..5bfe4dc --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64Orientation.sci @@ -0,0 +1,48 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcd128x64Orientation(mode) +// Function to set lcd orientation. +// +// Calling Sequence +// RPI_lcd128x64Orientation(mode) +// +// Parameters +// mode: Orientation Mode, integer from 0 to 3 +// +// Description +// This function sets the orientation of the lcd display. +// +// mode can take values: +// <itemizedlist> +// <listitem>0 :Portrait</listitem> +// <listitem>1 :Landscape</listitem> +// <listitem>2 :Portrait, flipped</listitem> +// <listitem>3 :Landscape, flipped</listitem> +// </itemizedlist> +// +// Examples +// RPI_lcd128x64Orientation(1) +// See also +// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="LOn#1#"+string(mode)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64circle.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64circle.sci new file mode 100755 index 0000000..96358a3 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64circle.sci @@ -0,0 +1,44 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcd128x64circle(x,y,r,color,fill) +// Function to draw a circle +// +// Calling Sequence +// RPI_lcd128x64circle(x,y,r,color,fill) +// +// Parameters +// x : integer, x coordinate of centre +// y : integer, y coordinate of centre +// r : integer, radius of the circle +// color: integer, color of the rectangle +// fill : 0 (for empty) or 1 (for filled) +// +// Description +// This function draws a circle of radius r with x,y as centre, specified color and fill. +// +// Examples +// RPI_lcd128x64circle(3,3,2,0,0) +// See also +// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="Lci#5#"+string(x)+"#"+string(y)+"#"+string(r)+"#"+string(color)+"#"+string(fill)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64clear.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64clear.sci new file mode 100755 index 0000000..5b80049 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64clear.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcd128x64clear(color) +// Function to clear the lcd screen +// +// Calling Sequence +// RPI_lcd128x64clear(color) +// +// Parameters +// color: integer, color of the lcd +// +// Description +// This function clears the lcd display to the given colour. +// +// Examples +// RPI_lcd128x64clear(0) +// See also +// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="LCl#1#"+string(color)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64ellipse.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64ellipse.sci new file mode 100755 index 0000000..b4281e6 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64ellipse.sci @@ -0,0 +1,45 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcd128x64ellipse(cx,cy,xr,yr,color,fill) +// Function to draw a ellipse +// +// Calling Sequence +// RPI_lcd128x64ellipse(cx,cy,xr,yr,color,fill) +// +// Parameters +// cx : integer, x coordinate of centre +// cy : integer, y coordinate of centre +// xr : integer, x radius +// yr : integer, y radius +// color: integer, color pf the ellipse +// fill : 0 (for empty) or 1 (for filled) +// +// Description +// This function draws an ellipse with centre at (cx,cy) x and y radii as xr and yr, specified color and fill +// +// Examples +// RPI_lcd128x64ellipse() +// See also +// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="Lel#6#"+string(cx)+"#"+string(cy)+"#"+string(xr)+"#"+string(yr)+"#"+string(color)+"#"+string(fill)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64line.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64line.sci new file mode 100755 index 0000000..951a663 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64line.sci @@ -0,0 +1,44 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcd128x64line(x0,y0,x1,y1,color) +// Function to plota line. +// +// Calling Sequence +// RPI_lcd128x64line(x0,y0,x1,y1,color) +// +// Parameters +// x0 : integer, initial x coordinate +// y0 : integer, initial y coordinate +// x1 : integer, final x coordinate +// y1 : integer, final y coordinate +// color: integer, color of the line +// +// Description +// This function plots a line from (x0,y0) to (x1,y1). +// +// Examples +// RPI_lcd128x64line(0,0,1,1,0) +// See also +// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="Lli#5#"+string(x0)+"#"+string(y0)+"#"+string(x1)+"#"+string(y1)+"#"+string(color)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64lineTo.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64lineTo.sci new file mode 100755 index 0000000..466713e --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64lineTo.sci @@ -0,0 +1,42 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcd128x64lineTo(x,y,color) +// Function to plot a line +// +// Calling Sequence +// RPI_lcd128x64lineTo(x,y,color) +// +// Parameters +// x : integer, final x coordinate +// y : integer, final y coordinate +// color: integer, color of the line +// +// Description +// This function draws a line from the current position to the point (x,y) specified. +// +// Examples +// RPI_lcd128x64lineTo(2,2,0) +// See also +// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="LlT#3#"+string(x)+"#"+string(y)+"#"+string(color)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64point.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64point.sci new file mode 100755 index 0000000..287b022 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64point.sci @@ -0,0 +1,42 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcd128x64point(x,y,color) +// Function to plot a point +// +// Calling Sequence +// RPI_lcd128x64point(x,y,color) +// +// Parameters +// x : integer, x coordinate +// y : integer, y coordinate +// color: integer, color of the point +// +// Description +// This function plots a point at x,y. +// +// Examples +// RPI_lcd128x64point(2,2,0) +// See also +// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="Lpo#3#"+string(x)+"#"+string(y)+"#"+string(color)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64putchar.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64putchar.sci new file mode 100755 index 0000000..a6b2724 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64putchar.sci @@ -0,0 +1,44 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcd128x64putchar(x,y,c,bg,fg) +// Function to print a single character. +// +// Calling Sequence +// RPI_lcd128x64putchar(x,y,c,bg,fg) +// +// Parameters +// x : integer, x coordinate of starting point +// y : integer, y coordinate of starting point +// c : integer, from 0 to 255, character to print +// bg: integer, background color +// fg: integer, foreground color +// +// Description +// This function prints a single character to the screen. +// +// Examples +// RPI_lcd128x64putchar(0,1,128,1,0) +// See also +// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="Lpc#5#"+string(x)+"#"+string(y)+"#"+string(c)+"#"+string(bg)+"#"+string(fg)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64puts.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64puts.sci new file mode 100755 index 0000000..6785f06 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64puts.sci @@ -0,0 +1,44 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcd128x64puts(x,y,s,bf,fg) +// Function to send a string to the lcd display +// +// Calling Sequence +// RPI_lcd128x64puts(x,y,s,bg,fg) +// +// Parameters +// x : integer, x coordinate of starting point +// y : integer, y coordinate of starting point +// s : string to send +// bg: integer, background color +// fg: integer, foreground color +// +// Description +// This function sends a string to the display. Obeys \n and \r formatting. +// +// Examples +// RPI_lcd128x64puts(0,0,'Talos guide you',0,1) +// See also +// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="LPu#5#"+string(x)+"#"+string(y)+"#"+string(s)+"#"+string(bg)+"#"+string(fg)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64rectangle.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64rectangle.sci new file mode 100755 index 0000000..ccda4c6 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64rectangle.sci @@ -0,0 +1,45 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcd128x64rectangle(x1,y1,x2,y2,color,fill) +// Function to draw a rectangle +// +// Calling Sequence +// RPI_lcd128x64rectangle(x1,y1,x2,y2,color,fill) +// +// Parameters +// x1 : integer, x coordinate of upper left corner +// y1 : integer, y coordinate of upper left corner +// x2 : integer, x coordinate of lower right corner +// y2 : integer, y coordinate of lower right corner +// color: integer, color of the rectangle +// fill : 0 (for empty) or 1 (for filled) +// +// Description +// This function draws a rectangle with (x1,y1) as the upper left point and (x2,y2) as the lower right point with specified color and fill. +// +// Examples +// RPI_lcd128x64rectangle(0,0,1,1,0,1) +// See also +// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="Lre#6#"+string(x1)+"#"+string(y1)+"#"+string(x2)+"#"+string(y2)+"#"+string(color)+"#"+string(fill)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setOrigin.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setOrigin.sci new file mode 100755 index 0000000..996b062 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setOrigin.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcd128x64setOrigin(x,y) +// Function to set origin +// +// Calling Sequence +// RPI_lcd128x64setOrigin(x,y) +// +// Parameters +// x: x coordinate +// y: y coordinate +// +// Description +// This function sets the origin of the lcd display +// +// Examples +// RPI_lcd128x64setOrigin(1,0) +// See also +// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="LOr#2#"+string(x)+"#"+string(y)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setup.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setup.sci new file mode 100755 index 0000000..60ded7d --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setup.sci @@ -0,0 +1,37 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_lcd128x64setup() +// Function to initialize the lcd display +// +// Calling Sequence +// RPI_lcd128x64setup() +// +// Description +// This function initialises the lcd display. +// +// Examples +// RPI_lcd128x64setup() +// See also +// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="Lse#0#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/lcd128x64/buildmacros.sce b/macros/Hardware/RasberryPi/lcd128x64/buildmacros.sce new file mode 100755 index 0000000..7d533f7 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd128x64/buildmacros.sce @@ -0,0 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/Hardware/RasberryPi/lcd128x64/names b/macros/Hardware/RasberryPi/lcd128x64/names new file mode 100755 index 0000000..8243971 --- /dev/null +++ b/macros/Hardware/RasberryPi/lcd128x64/names @@ -0,0 +1,12 @@ +RPI_lcd128x64Orientation +RPI_lcd128x64circle +RPI_lcd128x64clear +RPI_lcd128x64ellipse +RPI_lcd128x64line +RPI_lcd128x64lineTo +RPI_lcd128x64point +RPI_lcd128x64putchar +RPI_lcd128x64puts +RPI_lcd128x64rectangle +RPI_lcd128x64setOrigin +RPI_lcd128x64setup diff --git a/macros/Hardware/RasberryPi/mcp/RPI_mcp23008Setup.sci b/macros/Hardware/RasberryPi/mcp/RPI_mcp23008Setup.sci new file mode 100755 index 0000000..03963bd --- /dev/null +++ b/macros/Hardware/RasberryPi/mcp/RPI_mcp23008Setup.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_mcp23008Setup(pinBase,i2cAddress) +// Function for setting up 8-bit MCP23008 I2C GPIO expansion chip. +// +// Calling Sequence +// RPI_mcp23008Setup(pinBase,i2cAddress) +// +// Parameters +// pinBase : any number above 64. The consecutive 8 pins will be allocated alongwith. +// i2cAdress: integer, the I2C address obtained using RPI_i2cdetect function +// +// Description +// This function sets up the extension module for the 8-bit MCP23008 I2C GPIO expansion chip. +// +// Examples +// RPI_mcp23008Setup(73,64) +// See also +// RPI_sr595Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23016Setup, RPI_mcp23017Setup, RPI_mcp23s08Setup, RPI_mcp23s17Setup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="mp8#2#"+string(pinBase)+"#"+string(i2cAddress)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/mcp/RPI_mcp23016Setup.sci b/macros/Hardware/RasberryPi/mcp/RPI_mcp23016Setup.sci new file mode 100755 index 0000000..0424616 --- /dev/null +++ b/macros/Hardware/RasberryPi/mcp/RPI_mcp23016Setup.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_mcp23016Setup(pinBase,i2cAddress) +// Function for setting up 16-bit MCP23016 I2C GPIO expansion chip. +// +// Calling Sequence +// RPI_mcp23016Setup(pinBase,i2cAddress) +// +// Parameters +// pinBase : any number above 64. The consecutive 16 pins will be allocated alongwith. +// i2cAdress: integer, the I2C address obtained using RPI_i2cdetect function +// +// Description +// This function sets up the extension module for the MCP23017 (16-bit) I2C GPIO expansion chips. The MCP23016 is the fore-runner of the MCP23017 GPIO expansion chip and may be present on some older interface boards. +// +// Examples +// RPI_mcp23016Setup(73,100) +// See also +// RPI_sr595Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23008Setup, RPI_mcp23017Setup, RPI_mcp23s08Setup, RPI_mcp23s17Setup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="mp6#2#"+string(pinBase)+"#"+string(i2cAddress)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/mcp/RPI_mcp23017Setup.sci b/macros/Hardware/RasberryPi/mcp/RPI_mcp23017Setup.sci new file mode 100755 index 0000000..c453ebb --- /dev/null +++ b/macros/Hardware/RasberryPi/mcp/RPI_mcp23017Setup.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_mcp23017Setup(pinBase,i2cAddress) +// Function for setting up 16-bit MCP23017 I2C GPIO expansion chip. +// +// Calling Sequence +// RPI_mcp23017Setup(pinBase,i2cAddress) +// +// Parameters +// pinBase : any number above 64. The consecutive 16 pins will be allocated alongwith. +// i2cAdress: integer, the I2C address obtained using RPI_i2cdetect function +// +// Description +// This function setups the extension module for the 16-bit MCP23017 I2C GPIO expansion chip. +// +// Examples +// RPI_mcp23017Setup(73,100) +// See also +// RPI_sr595Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23008Setup, RPI_mcp23016Setup, RPI_mcp23s08Setup, RPI_mcp23s17Setup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="mp7#2#"+string(pinBase)+"#"+string(i2cAddress)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/mcp/RPI_mcp23s08Setup.sci b/macros/Hardware/RasberryPi/mcp/RPI_mcp23s08Setup.sci new file mode 100755 index 0000000..b5b215b --- /dev/null +++ b/macros/Hardware/RasberryPi/mcp/RPI_mcp23s08Setup.sci @@ -0,0 +1,42 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_mcp23s08Setup(pinBase,spiPort,devId) +// Function for setting up 8-bit MCP23s08 SPI GPIO expansion chip. +// +// Calling Sequence +// RPI_mcp23s08Setup(pinBase,spiPort,devId) +// +// Parameters +// pinBase: any number above 64. The consecutive 8 pins will be allocated alongwith. +// spiPort: 0 or 1 for one of the two SPI ports on the Raspberry Pi. +// devId : the ID of the MCP23s08 on the SPI port. +// +// Description +// This function setups the extension module for the 8-bit MCP23s08 SPI GPIO expansion chip. +// +// Examples +// RPI_mcp23s08Setup(67,1,0) +// See also +// RPI_sr595Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23008Setup, RPI_mcp23016Setup, RPI_mcp23017Setup, RPI_mcp23s17Setup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="ms8#3#"+string(pinBase)+"#"+string(spiPort)+"#"+string(devId)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/mcp/RPI_mcp23s17Setup.sci b/macros/Hardware/RasberryPi/mcp/RPI_mcp23s17Setup.sci new file mode 100755 index 0000000..4ba9fd6 --- /dev/null +++ b/macros/Hardware/RasberryPi/mcp/RPI_mcp23s17Setup.sci @@ -0,0 +1,42 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_mcp23s17Setup(pinBase,spiPort,devId) +// Function for setting up 16-bit MCP23s17 SPI GPIO expansion chip. +// +// Calling Sequence +// RPI_mcp23s17Setup(pinBase,spiPort,devId) +// +// Parameters +// pinBase: any number above 64. The consecutive 16 pins will be allocated alongwith. +// spiPort: 0 or 1 for one of the two SPI ports on the Raspberry Pi. +// devId : the ID of the MCP23s17 on the SPI port. +// +// Description +// This function setups the extension module for the 16-bit MCP23s17 SPI GPIO expansion chip. +// +// Examples +// RPI_mcp23s17Setup(67,0,0) +// See also +// RPI_sr595Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23008Setup, RPI_mcp23016Setup, RPI_mcp23017Setup, RPI_mcp23s08Setup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="ms7#3#"+string(pinBase)+"#"+string(spiPort)+"#"+string(devId)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/mcp/buildmacros.sce b/macros/Hardware/RasberryPi/mcp/buildmacros.sce new file mode 100755 index 0000000..7d533f7 --- /dev/null +++ b/macros/Hardware/RasberryPi/mcp/buildmacros.sce @@ -0,0 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/Hardware/RasberryPi/mcp/names b/macros/Hardware/RasberryPi/mcp/names new file mode 100755 index 0000000..23e7af0 --- /dev/null +++ b/macros/Hardware/RasberryPi/mcp/names @@ -0,0 +1,5 @@ +RPI_mcp23008Setup +RPI_mcp23016Setup +RPI_mcp23017Setup +RPI_mcp23s08Setup +RPI_mcp23s17Setup diff --git a/macros/Hardware/RasberryPi/names b/macros/Hardware/RasberryPi/names index fa64776..9f20c93 100644..100755 --- a/macros/Hardware/RasberryPi/names +++ b/macros/Hardware/RasberryPi/names @@ -1,21 +1,5 @@ GetRPISupportFunctions IsRPISupportFunction -RPI_DelayMicro -RPI_DelayMilli -RPI_DigitalIn -RPI_DigitalOut -RPI_DigitalSetup -RPI_GetMicros -RPI_GetMillis -RPI_HardPWMSetClock -RPI_HardPWMSetMode -RPI_HardPWMSetRange -RPI_HardPWMWrite -RPI_PinISR -RPI_SerialClose -RPI_SerialFlush -RPI_SerialGetChar -RPI_SerialSendChar -RPI_SerialSendData -RPI_SerialSetup -u16RPISerialDataAvail +RPI_adress +raspi +raspi_close diff --git a/macros/Hardware/RasberryPi/pcf/RPI_pcf8574Setup.sci b/macros/Hardware/RasberryPi/pcf/RPI_pcf8574Setup.sci new file mode 100755 index 0000000..f3e7942 --- /dev/null +++ b/macros/Hardware/RasberryPi/pcf/RPI_pcf8574Setup.sci @@ -0,0 +1,43 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_pcf8574Setup(pinBase,i2cAddress) +// Function for setting up PCF8574 8-bit GPIO expander IC +// +// Calling Sequence +// RPI_pcf8574Setup(pinBase,i2cAddress) +// +// Parameters +// pinBase : any number above 64. The consecutive 8 pins will be allocated alongwith. +// i2cAddress: I2C address obtained using RPI_i2cdetect function +// +// Description +// This function sets up the extension module for the PCF8574 8-bit GPIO expander IC. Can be called multiple times for multiple PCF8574 using different pinBase for each. +// +//You don’t need to specify the number of pins here – the PCF8754 has 8 pins. +// +// Examples +// RPI_pcf8574Setup(67,100) +// See also +// RPI_pcf8591Setup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="pf7#2#"+string(pinBase)+"#"+string(i2cAddress)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/pcf/RPI_pcf8591Setup.sci b/macros/Hardware/RasberryPi/pcf/RPI_pcf8591Setup.sci new file mode 100755 index 0000000..8705490 --- /dev/null +++ b/macros/Hardware/RasberryPi/pcf/RPI_pcf8591Setup.sci @@ -0,0 +1,43 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_pcf8591Setup(pinBase,i2cAddress) +// Function for setting up 8-bit PCF8591 Analog IO expander IC +// +// Calling Sequence +// RPI_pcf8591Setup(pinBase,i2cAddress) +// +// Parameters +// pinBase : any number above 64.The consecutive 4 pins will be allocated alongwith. +// i2cAddress: I2C address obtained using RPI_i2cdetect function +// +// Description +// This function sets up the extension module for the PCF8591 8-bit GPIO expander IC. Can be called multiple times for multiple PCF8591 using different pinBase for each. +// +//Specifying the number of pins is not necessary – the PCF8791 has 4 pins – the analog output uses base pin number 0 – the same as analog input 0. +// +// Examples +// RPI_pcf8591Setup(67,64) +// See also +// RPI_pcf8574Setup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="pf9#2#"+string(pinBase)+"#"+string(i2cAddress)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/pcf/buildmacros.sce b/macros/Hardware/RasberryPi/pcf/buildmacros.sce new file mode 100755 index 0000000..7d533f7 --- /dev/null +++ b/macros/Hardware/RasberryPi/pcf/buildmacros.sce @@ -0,0 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/Hardware/RasberryPi/pcf/names b/macros/Hardware/RasberryPi/pcf/names new file mode 100755 index 0000000..3e326a0 --- /dev/null +++ b/macros/Hardware/RasberryPi/pcf/names @@ -0,0 +1,2 @@ +RPI_pcf8574Setup +RPI_pcf8591Setup diff --git a/macros/Hardware/RasberryPi/piGlow/RPI_piGlow1.sci b/macros/Hardware/RasberryPi/piGlow/RPI_piGlow1.sci new file mode 100755 index 0000000..e093238 --- /dev/null +++ b/macros/Hardware/RasberryPi/piGlow/RPI_piGlow1.sci @@ -0,0 +1,42 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_piGlow1(leg,ring,intensity) +// Function to modify a single LED on the piGlow +// +// Calling Sequence +// RPI_piGlow1(leg,ring,intensity) +// +// Parameters +// leg : leg number +// ring : ring number +// intensity: brightness from 0 (off) to 255 (full) +// +// Description +// The function modifies the brightness of the single specified LED. +// +// Examples +// RPI_piGlow1(0,0,125) +// See also +// RPI_piGlowLeg, RPI_piGlowRing, RPI_piGlowSetup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="pG1#3#"+string(leg)+"#"+string(ring)+"#"+string(intensity)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/piGlow/RPI_piGlowLeg.sci b/macros/Hardware/RasberryPi/piGlow/RPI_piGlowLeg.sci new file mode 100755 index 0000000..d042579 --- /dev/null +++ b/macros/Hardware/RasberryPi/piGlow/RPI_piGlowLeg.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_piGlowLeg(leg,intensity) +// Function to modify a full leg of LEDs on the piGlow +// +// Calling Sequence +// RPI_piGlowLeg(leg,intensity) +// +// Parameters +// leg : leg number +// intensity: brightness from 0 (off) to 255 (full) +// +// Description +// This function modifies the brightness of all the LEDs in the single specified leg of piGlow. +// +// Examples +// RPI_piGlowLeg(0,100) +// See also +// RPI_piGlow1, RPI_piGlowRing, RPI_piGlowSetup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="pGL#2#"+string(leg)+"#"+string(intensity)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/piGlow/RPI_piGlowRing.sci b/macros/Hardware/RasberryPi/piGlow/RPI_piGlowRing.sci new file mode 100755 index 0000000..ef81620 --- /dev/null +++ b/macros/Hardware/RasberryPi/piGlow/RPI_piGlowRing.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_piGlowRing(ring,intensity) +// Function to modify a full ring of LEDs on the piGlow +// +// Calling Sequence +// RPI_piGlowRing(ring,intensity) +// +// Parameters +// ring : ring number +// intensity: brightness from 0 (off) to 255 (full) +// +// Description +// This function modifies the brightness of all the LEDs in the single specified ring of piGlow. +// +// Examples +// RPI_piGlowRing(1,200) +// See also +// RPI_piGlowLeg, RPI_piGlow1, RPI_piGlowSetup +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="pGR#2#"+string(ring)+"#"+string(intensity)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/piGlow/RPI_piGlowSetup.sci b/macros/Hardware/RasberryPi/piGlow/RPI_piGlowSetup.sci new file mode 100755 index 0000000..718fa3b --- /dev/null +++ b/macros/Hardware/RasberryPi/piGlow/RPI_piGlowSetup.sci @@ -0,0 +1,42 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_piGlowSetup(Empty) +// Function to initialize the piGlow board +// +// Calling Sequence +// RPI_piGlowSetup(Empty) +// +// Parameters +// Empty: integer, 0 or 1. If 1, then all the LEDs will be turned off to start with. +// +// Description +// This initialises the PiGlow devLib software. The I2C kernel module needs to be pre-loaded. ThePiGlow board has an SN3218 I2C LED controller and 18 LEDs arranged in 3 “legs†of 6 LEDs. (or 6 “rings†of 3 LEDs). +// +// The LED colours in each leg match and are in the order Red (at the outside), Yellow, Orange, Green, Blue and White (in the center) +// +// Examples +// RPI_piGlowSetup(TRUE) +// See also +// RPI_piGlowLeg, RPI_piGlow1, RPI_piGlowRing +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="pGS#1#"+string(Empty)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/piGlow/buildmacros.sce b/macros/Hardware/RasberryPi/piGlow/buildmacros.sce new file mode 100755 index 0000000..7d533f7 --- /dev/null +++ b/macros/Hardware/RasberryPi/piGlow/buildmacros.sce @@ -0,0 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/Hardware/RasberryPi/piGlow/names b/macros/Hardware/RasberryPi/piGlow/names new file mode 100755 index 0000000..b63ec8f --- /dev/null +++ b/macros/Hardware/RasberryPi/piGlow/names @@ -0,0 +1,4 @@ +RPI_piGlow1 +RPI_piGlowLeg +RPI_piGlowRing +RPI_piGlowSetup diff --git a/macros/Hardware/RasberryPi/pinMap/RPI_physToGpio.sci b/macros/Hardware/RasberryPi/pinMap/RPI_physToGpio.sci new file mode 100755 index 0000000..9a59caa --- /dev/null +++ b/macros/Hardware/RasberryPi/pinMap/RPI_physToGpio.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_physToGpio(pin) +// Function to check the GPIO pin number corresponding to given physical pin number. +// +// Calling Sequence +// p=RPI_physToGpio(pin) +// +// Parameters +// pin: The pin number to check in physical numbering sequence. +// +// Description +// This funtion return the GPIO pin number corresponding to the supplied physical pin number. +// +// Examples +// p=RPI_physToGpio(11) +// See also +// RPI_wpiToGpio +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="ptG#1#"+string(pin)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/pinMap/RPI_wpiToGpio.sci b/macros/Hardware/RasberryPi/pinMap/RPI_wpiToGpio.sci new file mode 100755 index 0000000..deed426 --- /dev/null +++ b/macros/Hardware/RasberryPi/pinMap/RPI_wpiToGpio.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_wpiToGpio(pin) +// Function to check the GPIO pin number corresponding to given wiringpi pin number. +// +// Calling Sequence +// p=RPI_wpiToGpio(pin) +// +// Parameters +// pin: The pin number to check in wiringpi numbering sequence. +// +// Description +// This funtion return the GPIO pin number corresponding to the supplied wiringpi pin number. +// +// Examples +// p=RPI_wpiToGpio(0) +// See also +// RPI_physToGpio +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="wtG#1#"+string(pin)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/pinMap/buildmacros.sce b/macros/Hardware/RasberryPi/pinMap/buildmacros.sce new file mode 100755 index 0000000..7d533f7 --- /dev/null +++ b/macros/Hardware/RasberryPi/pinMap/buildmacros.sce @@ -0,0 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/Hardware/RasberryPi/pinMap/names b/macros/Hardware/RasberryPi/pinMap/names new file mode 100755 index 0000000..71efa23 --- /dev/null +++ b/macros/Hardware/RasberryPi/pinMap/names @@ -0,0 +1,2 @@ +RPI_physToGpio +RPI_wpiToGpio diff --git a/macros/Hardware/RasberryPi/pwm/RPI_pwmClock.sci b/macros/Hardware/RasberryPi/pwm/RPI_pwmClock.sci new file mode 100755 index 0000000..d065353 --- /dev/null +++ b/macros/Hardware/RasberryPi/pwm/RPI_pwmClock.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_pwmClock(value) +// Function to set the divisor for the PWM clock. +// +// Calling Sequence +// RPI_pwmClock(value) +// +// Parameters +// value: The divisor for the PWM clock. +// +// Description +// This function sets the divisor for the PWM clock. +// +// Examples +// RPI_pwmClock(100) +// See also +// RPI_pwmMode, RPI_pwmRange, RPI_pwmToneWrite, RPI_pwmWrite +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="pwC#1#"+string(value)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/pwm/RPI_pwmMode.sci b/macros/Hardware/RasberryPi/pwm/RPI_pwmMode.sci new file mode 100755 index 0000000..13d0c36 --- /dev/null +++ b/macros/Hardware/RasberryPi/pwm/RPI_pwmMode.sci @@ -0,0 +1,46 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_pwmMode(Mode) +// Function to set the mode for the PWM generator +// +// Calling Sequence +// RPI_pwmMode(mode) +// +// Parameters +// mode: The mode to set for the PWM generator. 'ms' (for mark:space) or 'bal' (for balanced) +// +// Description +// This function sets the mode for the PWM generator. The PWM generator can run in 2 modes – “balanced†and “mark:spaceâ€. The mark:space mode is traditional, however the default mode in the Pi is “balancedâ€. Switch modes by supplying the parameter: bal or ms +// +// Examples +// RPI_pwmMode('bal') +// See also +// RPI_pwmRange, RPI_pwmClock, RPI_pwmToneWrite, RPI_pwmWrite +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + if Mode=='ms' then + commande="pwM#1#0#"; + elseif Mode=='bal' then + commande="pwM#1#1#"; + else: + error("mode should be ""ms"" or ""bal"""); + end + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/pwm/RPI_pwmRange.sci b/macros/Hardware/RasberryPi/pwm/RPI_pwmRange.sci new file mode 100755 index 0000000..6a1503a --- /dev/null +++ b/macros/Hardware/RasberryPi/pwm/RPI_pwmRange.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_pwmRange(value) +// Function to set the divisor for the PWM clock. +// +// Calling Sequence +// RPI_pwmRange(value) +// +// Parameters +// value: maximum of the range for the PWM generator. +// +// Description +// This function sets the range register in the PWM generator. The default is 1024. +// +// Examples +// RPI_pwmRange(512) +// See also +// RPI_pwmMode, RPI_pwmClock, RPI_pwmToneWrite, RPI_pwmWrite +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="pwR#1#"+string(value)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/pwm/RPI_pwmToneWrite.sci b/macros/Hardware/RasberryPi/pwm/RPI_pwmToneWrite.sci new file mode 100755 index 0000000..d7ff6ed --- /dev/null +++ b/macros/Hardware/RasberryPi/pwm/RPI_pwmToneWrite.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_pwmToneWrite(pin,freq) +// Function to write a tone of a given frequency to the pin +// +// Calling Sequence +// RPI_pwmToneWrite(pin,freq) +// +// Parameters +// pin : The pin to set the frequency on. Numbering to be followed as initiated using RPI_pinNumbering. +// freq: frequency to write +// +// Description +// This function write the given frequency tone to the given pin. +// +// Examples +// RPI_pwmToneWrite(0,100) +// See also +// RPI_pwmMode, RPI_pwmRange, RPI_pwmClock, RPI_pwmWrite, PRI_pinNumbering +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="pwT#2#"+string(pin)+"#"+string(freq)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/pwm/RPI_pwmWrite.sci b/macros/Hardware/RasberryPi/pwm/RPI_pwmWrite.sci new file mode 100755 index 0000000..113547a --- /dev/null +++ b/macros/Hardware/RasberryPi/pwm/RPI_pwmWrite.sci @@ -0,0 +1,45 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_pwmWrite(pin,value) +// Function to write voltage value to the PWM register for the given pin. +// +// Calling Sequence +// RPI_pwmWrite(pin,value) +// +// Parameters +// pin : The pin number set the voltage at. Numbering sequence to be followed as initiated using RPI_pinNumbering function. +// value: The voltage to set at the given pin. Range is 0-1024. +// +// Description +// Writes the value to the PWM register for the given pin. The Raspberry Pi has one on-board PWM pin, pin 1 (BMC_GPIO 18, Phys 12). Other PWM devices may have other PWM ranges. +// +// Examples +// RPI_pwmWrite(1,500) +// See also +// RPI_pwmMode, RPI_pwmRange, RPI_pwmClock, RPI_pwmToneWrite +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + if [0<value,value<1024] then + commande="pwW#2#"+string(pin)+"#"+string(value)+"#"; + else + error("Voltage has to be between 0 and 1024"); + end + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/pwm/buildmacros.sce b/macros/Hardware/RasberryPi/pwm/buildmacros.sce new file mode 100755 index 0000000..7d533f7 --- /dev/null +++ b/macros/Hardware/RasberryPi/pwm/buildmacros.sce @@ -0,0 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/Hardware/RasberryPi/pwm/names b/macros/Hardware/RasberryPi/pwm/names new file mode 100755 index 0000000..87e7088 --- /dev/null +++ b/macros/Hardware/RasberryPi/pwm/names @@ -0,0 +1,5 @@ +RPI_pwmClock +RPI_pwmMode +RPI_pwmRange +RPI_pwmToneWrite +RPI_pwmWrite diff --git a/macros/Hardware/RasberryPi/raspi.sci b/macros/Hardware/RasberryPi/raspi.sci new file mode 100755 index 0000000..4da09ca --- /dev/null +++ b/macros/Hardware/RasberryPi/raspi.sci @@ -0,0 +1,94 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+global RPI_piAdress;
+
+if getos()=="Linux" then
+ RPI_MacrosPath=get_absolute_file_path("raspi.sci");
+ RPI_MacrosPath=part(RPI_MacrosPath,1:(length(RPI_MacrosPath)-7));
+ RPI_MacrosPath=RPI_MacrosPath+'src/python/';
+// disp("Linux");
+ function raspi(adress,local,username)
+ // Function to initiate the connection to the raspberry pi
+ //
+ // Calling Sequence
+ // raspi(adress,local,username)
+ //
+ // Parameters
+ // address : Network address of the raspberry pi. Eg:10.42.0.82
+ // local : username of the local computer.
+ // username: username on the raspberry pi.
+ //
+ // Description
+ // This program initiates the connection to the raspberry pi at the given address by running the python server script on port 9077 on the pi.
+ //
+ // Examples
+ // raspi('10.42.0.82','panda','pi')
+ // See also
+ // raspi_close
+ //
+ // Authors
+ // Jorawar Singh
+
+ global RPI_piAdress;
+ RPI_piAdress=adress;
+
+ disp("Step 1/6")
+ TCL_EvalStr("if {[file exists /home/"+local+"/.ssh/id_rsa]} {} else {exec ssh-keygen -N """" -f /home/"+local+"/.ssh/id_rsa -q}");
+ disp("Step 2/6")
+ TCL_EvalStr("exec ssh-add >logs.txt 2>&1");
+ disp("Step 3/6")
+ TCL_EvalStr("exec ssh-copy-id -i /home/"+local+"/.ssh/id_rsa.pub "+username+"@"+adress+" > logs.txt 2>&1");
+ disp("Step 4/6")
+ TCL_EvalStr("exec rsync -avz "+RPI_MacrosPath+"serverWP.py "+username+"@"+adress+":.scilab/ >logs.txt");
+ disp("Step 5/6")
+ TCL_EvalStr("exec ssh "+username+"@"+adress+" sudo python /home/"+username+"/.scilab/serverWP.py &");
+ disp("Step 6/6")
+ TCL_EvalStr(["file delete logs.txt";"file delete &1"]);
+ endfunction
+elseif getos()=='Windows' then
+ tempPath=get_absolute_file_path("raspi.sci");
+ RPI_MacrosPath=strsubst(tempPath,'\','/');
+ RPI_MacrosPath=part(RPI_MacrosPath,1:(length(RPI_MacrosPath)-7));
+ RPI_MacrosPath=RPI_MacrosPath+'src/python/';
+ function raspi(adress,username)
+ // Function to initiate the connection to the raspberry pi
+ //
+ // Calling Sequence
+ // raspi(adress,username)
+ //
+ // Parameters
+ // address : Network address of the raspberry pi. Eg:10.42.0.82
+ // username: username on the raspberry pi.
+ //
+ // Description
+ // This program initiates the connection to the raspberry pi at the given address by running the python server script on port 9077 on the pi.
+ //
+ // Examples
+ // raspi('169.254.191.116','pi')
+ // See also
+ // raspi_close
+ //
+ // Authors
+ // Jorawar Singh
+
+ global RPI_piAdress;
+ RPI_piAdress=adress;
+
+ disp("Step 1/3")
+ TCL_EvalStr("exec mintty ssh "+username+"@"+adress+" mkdir .scilab");
+ disp("Step 2/3")
+ TCL_EvalStr("exec mintty scp "+RPI_MacrosPath+"serverWP.py "+username+"@"+adress+":/home/"+username+"/.scilab/");
+ disp("Step 3/3 (Wait ~15 seconds)")
+ TCL_EvalStr("exec mintty ssh "+username+"@"+adress+" sudo python /home/"+username+"/.scilab/serverWP.py &");
+ sleep(15000)
+ TCL_EvalStr("exec taskkill /IM mintty.exe");
+ endfunction
+end
diff --git a/macros/Hardware/RasberryPi/raspi_close.sci b/macros/Hardware/RasberryPi/raspi_close.sci new file mode 100755 index 0000000..b5bb0ee --- /dev/null +++ b/macros/Hardware/RasberryPi/raspi_close.sci @@ -0,0 +1,34 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function raspi_close() +// Function to close an open Raspberry-Pi connection. +// +// Calling Sequence +// raspi_close() +// +// Description +// This function causes the pyhton server script running on Raspberry pi to close, irrespective of it being started natively on pi or by using raspi function. +// +// Examples +// raspi_close() +// See also +// raspi +// +// Authors +// Jorawar Singh + + commande="cls#0#"; + if getos()=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci deleted file mode 100644 index 6eb29a1..0000000 --- a/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci +++ /dev/null @@ -1,37 +0,0 @@ -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in - -function bytes = RPI_SerialDataAvail(fd) -// Function to get number of data bytes available on serial port specified by -// file descriptor -// Calling Sequence -// RPI_SerialDataAvail(fd) -// -// Parameters -// fd : file descriptor for already opened serial port -// Description -// This functions returns number of characters available to read, -// otherwise reads -1 in case of error. This function can be used to check -// new data is available on serial port -// Examples -// serial = RPI_SerialOpen("/dev/ttyAMA0", 9600); -// charsToRead = RPI_SerialDataAvail(serial); -// See also -// RPI_SerialOpen RPI_SerialGetChar -// -// -// Authors -// Siddhesh Wani -// ----------------------------------------------------------------- - -// This is curretly dummy function. It provides no functionality but is required -// for providing support for generating C code for RPi. - -bytes = 0; - -endfunction
\ No newline at end of file diff --git a/macros/Scilab-Arduino/GetArduinoFunctions.sci b/macros/Scilab-Arduino/GetArduinoFunctions.sci index eff61fe..69c4ab3 100644 --- a/macros/Scilab-Arduino/GetArduinoFunctions.sci +++ b/macros/Scilab-Arduino/GetArduinoFunctions.sci @@ -31,6 +31,6 @@ ArduinoFunctions = [ "cmd_servo_attach" "cmd_servo_detach" "cmd_servo_move" - "i2c_dev"]; + "cmd_i2c_dev"]; endfunction diff --git a/macros/Scilab-Arduino/GetArduinoSetupFunctions.sci b/macros/Scilab-Arduino/GetArduinoSetupFunctions.sci index d310648..78bda03 100644 --- a/macros/Scilab-Arduino/GetArduinoSetupFunctions.sci +++ b/macros/Scilab-Arduino/GetArduinoSetupFunctions.sci @@ -25,7 +25,7 @@ ArduinoSetupFunctions = [ "cmd_dcmotor_setup" "cmd_servo_attach" "cmd_servo_detach" - "i2c_dev"]; + "cmd_i2c_dev"]; endfunction diff --git a/macros/Scilab-Arduino/buildmacros.sce b/macros/Scilab-Arduino/buildmacros.sce index dfeb475..7d533f7 100644..100755 --- a/macros/Scilab-Arduino/buildmacros.sce +++ b/macros/Scilab-Arduino/buildmacros.sce @@ -1,28 +1,13 @@ -// This file is released into the public domain - -Directories = [ "ASTManagement", ... - "CCodeGeneration", ... - "ErrorMessages", ... - "findDeps", ... - "FunctionAnnotation", ... - "FunctionList", ... - "GeneralFunctions", ... - "SymbolTable", ... - "ToolInitialization"... - "Hardware/AVR"... - "Scilab-Arduino" ]; - - -current_path_buildmacros = get_absolute_file_path("buildmacros.sce"); - -for K=1:size(Directories,"*") - myfile = current_path_buildmacros + filesep() + Directories(K) + filesep() + "buildmacros.sce"; - if isfile(myfile) then - exec(myfile); - end -end - -clear current_path_buildmacros; +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 325f4d5..436d8bc 100644 --- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -302,6 +302,7 @@ PrintStringInfo('i80'+ArgSeparator+'s0',ClassFileName,'file','y'); PrintStringInfo('u160'+ArgSeparator+'s0',ClassFileName,'file','y');
PrintStringInfo('i160'+ArgSeparator+'s0',ClassFileName,'file','y');
PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('z0'+ArgSeparator+'c0',ClassFileName,'file','y');
PrintStringInfo('d2'+ArgSeparator+'s2',ClassFileName,'file','y');
PrintStringInfo('u82'+ArgSeparator+'s2',ClassFileName,'file','y');
@@ -317,7 +318,6 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
-
// ---------------------
// --- Class Int8. ---
// ---------------------
@@ -920,6 +920,299 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,E INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
// -------------------
+// --- Class Isrow. ---
+// -------------------
+ClassName = 'Isrow';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+//Was FA_TP_USER
+//Cause some trouble if user specify some precision and if input(and also output) is complex.
+PrintStringInfo('OUT(1).TP= ''g''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+//---Function list class. ----
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('s0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('g2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('g0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('z2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('z0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('u162'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('u160'+ArgSeparator+'g0',ClassFileName,'file','y');
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'isrow';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+// -------------------
+// --- Class Nthroot. ---
+// -------------------
+ClassName = 'Nthroot';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+//Was FA_TP_USER
+//Cause some trouble if user specify some precision and if input(and also output) is complex.
+PrintStringInfo('OUT(1).TP= ''d''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+//---Function list class. ----
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('d2d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d2d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s0s0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('s2s2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s2s0'+ArgSeparator+'d2',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'nthroot';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+// -------------------
+// --- Class Pmodulo. ---
+// -------------------
+ClassName = 'Pmodulo';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+//Was FA_TP_USER
+//Cause some trouble if user specify some precision and if input(and also output) is complex.
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+//---Function list class. ----
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('d2d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s0s0'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('s2s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('i160i160'+ArgSeparator+'i160',ClassFileName,'file','y');
+PrintStringInfo('i162i162'+ArgSeparator+'i162',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'pmodulo';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+// -------------------
+// --- Class Nanmax. ---
+// -------------------
+ClassName = 'Nanmax';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= FA_SZ_SEL1(IN(1).SZ(1),IN(2).VAL)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= FA_SZ_SEL2(IN(1).SZ(2),IN(2).VAL)',ClassFileName,'file','y');
+//---Function list class. ----
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('d2g2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('s2g2'+ArgSeparator+'s2',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'nanmax';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+// -------------------
+// --- Class Issquare. ---
+// -------------------
+ClassName = 'Issquare';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+//Was FA_TP_USER
+//Cause some trouble if user specify some precision and if input(and also output) is complex.
+PrintStringInfo('OUT(1).TP= ''g''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+//---Function list class. ----
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('s0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('g2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('g0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('z2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('z0'+ArgSeparator+'g0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'issquare';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+// -------------------
+// --- Class Isscalar. ---
+// -------------------
+ClassName = 'Isscalar';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+//Was FA_TP_USER
+//Cause some trouble if user specify some precision and if input(and also output) is complex.
+PrintStringInfo('OUT(1).TP= ''g''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+//---Function list class. ----
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('s0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('g2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('g0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('z2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('z0'+ArgSeparator+'g0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'isscalar';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+// -------------------
+// --- Class Iscolumn. ---
+// -------------------
+ClassName = 'Iscolumn';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+//Was FA_TP_USER
+//Cause some trouble if user specify some precision and if input(and also output) is complex.
+PrintStringInfo('OUT(1).TP= ''g''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+//---Function list class. ----
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('s0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('g2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('g0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('z2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('z0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('u162'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('u160'+ArgSeparator+'g0',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'iscolumn';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+// -------------------
+// --- Class Ismatrix. ---
+// -------------------
+ClassName = 'Ismatrix';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+//Was FA_TP_USER
+//Cause some trouble if user specify some precision and if input(and also output) is complex.
+PrintStringInfo('OUT(1).TP= ''g''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+//---Function list class. ----
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('s0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('g2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('g0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('z2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('z0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('u162'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('u160'+ArgSeparator+'g0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'ismatrix';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+// -------------------
+// --- Class Ismatrix. ---
+// -------------------
+ClassName = 'Ismatrix';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+//Was FA_TP_USER
+//Cause some trouble if user specify some precision and if input(and also output) is complex.
+PrintStringInfo('OUT(1).TP= ''g''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+//---Function list class. ----
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('s0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('g2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('g0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('z2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('z0'+ArgSeparator+'g0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'ismatrix';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+// -------------------
// --- Class Isreal. ---
// -------------------
ClassName = 'Isreal';
@@ -1684,6 +1977,11 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+FunctionName = 'median'; // BJ : Done AS : Float_Done
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
FunctionName = 'st_deviation'; // BJ : Not implemented
PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
@@ -4525,6 +4823,244 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class TOEPLITZ ----------------
+//------------------------------------
+ClassName = 'toeplitz';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(2).SZ(2)',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('u82u82'+ArgSeparator+'u82',ClassFileName,'file','y');
+PrintStringInfo('u82'+ArgSeparator+'u82',ClassFileName,'file','y');
+PrintStringInfo('u162u162'+ArgSeparator+'u162',ClassFileName,'file','y');
+PrintStringInfo('u162'+ArgSeparator+'u162',ClassFileName,'file','y');
+PrintStringInfo('g2g2'+ArgSeparator+'g2',ClassFileName,'file','y');
+PrintStringInfo('g2'+ArgSeparator+'g2',ClassFileName,'file','y');
+PrintStringInfo('z2z2'+ArgSeparator+'z2',ClassFileName,'file','y');
+PrintStringInfo('z2'+ArgSeparator+'z2',ClassFileName,'file','y');
+PrintStringInfo('s2s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('c2c2'+ArgSeparator+'c2',ClassFileName,'file','y');
+PrintStringInfo('c2'+ArgSeparator+'c2',ClassFileName,'file','y');
+PrintStringInfo('i82i82'+ArgSeparator+'i82',ClassFileName,'file','y');
+PrintStringInfo('i82'+ArgSeparator+'i82',ClassFileName,'file','y');
+PrintStringInfo('i162i162'+ArgSeparator+'i162',ClassFileName,'file','y');
+PrintStringInfo('i162'+ArgSeparator+'i162',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'toeplitz';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class CROSS ----------------
+//------------------------------------
+ClassName = 'cross';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('z2z2'+ArgSeparator+'z2',ClassFileName,'file','y');
+PrintStringInfo('c2c2'+ArgSeparator+'c2',ClassFileName,'file','y');
+PrintStringInfo('s2s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('u82u82'+ArgSeparator+'u82',ClassFileName,'file','y');
+PrintStringInfo('i82i82'+ArgSeparator+'i82',ClassFileName,'file','y');
+PrintStringInfo('u162u162'+ArgSeparator+'u162',ClassFileName,'file','y');
+PrintStringInfo('i162i162'+ArgSeparator+'i162',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'cross';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class ISEQUAL ----------------
+//------------------------------------
+ClassName = 'isequal';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+//Was FA_TP_USER
+//Cause some trouble if user specify some precision and if input(and also output) is complex.
+PrintStringInfo('OUT(1).TP= ''g''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('d2d2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('s0s0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('s2s2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('z0z0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('z2z2'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('u160u160'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('u162u162'+ArgSeparator+'g0',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'isequal';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class ERF ----------------
+//------------------------------------
+ClassName = 'erf';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s0'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'erf';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class ERFC ----------------
+//------------------------------------
+ClassName = 'erfc';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s0'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'erfc';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class ERFCX ----------------
+//------------------------------------
+ClassName = 'erfcx';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s0'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'erfcx';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class ERFINV ----------------
+//------------------------------------
+ClassName = 'erfinv';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s0'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'erfinv';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
// -------------------
// --- Class Spec. ---
// -------------------
@@ -5817,6 +6353,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u80'+ArgSeparator+'',ClassFileName,'file','y');
+PrintStringInfo('d0'+ArgSeparator+'',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_digitalWriteByte';
@@ -5869,6 +6406,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u160'+ArgSeparator+'',ClassFileName,'file','y');
+PrintStringInfo('d0'+ArgSeparator+'',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_pwmClock';
@@ -5893,6 +6431,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u320'+ArgSeparator+'',ClassFileName,'file','y');
+PrintStringInfo('d0'+ArgSeparator+'',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_pwmRange';
@@ -5949,6 +6488,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u80'+ArgSeparator+'i80',ClassFileName,'file','y');
+PrintStringInfo('d0'+ArgSeparator+'i80',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_I2CSetup';
@@ -5981,6 +6521,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u160'+ArgSeparator+'i80',ClassFileName,'file','y');
+PrintStringInfo('d0'+ArgSeparator+'i80',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_I2CRead';
@@ -6037,6 +6578,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u80'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('d0'+ArgSeparator+'u80',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_getAlt';
@@ -6073,6 +6615,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u160'+ArgSeparator+'u160',ClassFileName,'file','y');
+PrintStringInfo('d0'+ArgSeparator+'u160',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_gertboardAnalogRead';
@@ -6097,6 +6640,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u80'+ArgSeparator+'g2',ClassFileName,'file','y');
+PrintStringInfo('d0'+ArgSeparator+'g2',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_serialGetchar';
@@ -6118,6 +6662,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u80u80'+ArgSeparator+'',ClassFileName,'file','y');
+PrintStringInfo('d0d0'+ArgSeparator+'',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_pinModeAlt';
@@ -6182,6 +6727,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u80u160'+ArgSeparator+'',ClassFileName,'file','y');
+PrintStringInfo('d0d0'+ArgSeparator+'',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_pwmWrite';
@@ -6214,6 +6760,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u160u160'+ArgSeparator+'',ClassFileName,'file','y');
+PrintStringInfo('d0d0'+ArgSeparator+'',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_gertboardAnalogWrite';
@@ -6238,6 +6785,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u80g2'+ArgSeparator+'',ClassFileName,'file','y');
+PrintStringInfo('d0g2'+ArgSeparator+'',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_pinMode';
@@ -6282,6 +6830,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u80u320'+ArgSeparator+'',ClassFileName,'file','y');
+PrintStringInfo('d0d0'+ArgSeparator+'',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_softToneWrite';
@@ -6306,6 +6855,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u80i160'+ArgSeparator+'i80',ClassFileName,'file','y');
+PrintStringInfo('d0d0'+ArgSeparator+'i80',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_waitForInterrupt';
@@ -6330,6 +6880,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u160u160'+ArgSeparator+'i80',ClassFileName,'file','y');
+PrintStringInfo('d0d0'+ArgSeparator+'i80',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_I2CWrite';
@@ -6362,6 +6913,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('g2u320'+ArgSeparator+'i80',ClassFileName,'file','y');
+PrintStringInfo('g2d0'+ArgSeparator+'i80',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_serialOpen';
@@ -6386,6 +6938,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u160u80'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_pcf8574Setup';
@@ -6423,6 +6976,7 @@ PrintStringInfo('NOUT= 1',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u80u80u80'+ArgSeparator+'',ClassFileName,'file','y');
+PrintStringInfo('d0d0d0'+ArgSeparator+'',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_lcdPosition';
@@ -6448,6 +7002,7 @@ PrintStringInfo('NOUT= 1',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u160u160u160'+ArgSeparator+'i80',ClassFileName,'file','y');
+PrintStringInfo('d0d0d0'+ArgSeparator+'i80',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_I2CWriteReg8';
@@ -6473,6 +7028,7 @@ PrintStringInfo('NOUT= 1',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u80u80u80'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('d0d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_shiftIn';
@@ -6497,6 +7053,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u80u160u160'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('d0d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_softPwmCreate';
@@ -6521,6 +7078,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u160u160u160'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('d0d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_mcp23s08Setup';
@@ -6549,6 +7107,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u80u80u80u80'+ArgSeparator+'',ClassFileName,'file','y');
+PrintStringInfo('d0d0d0d0'+ArgSeparator+'',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_shiftOut';
@@ -6573,6 +7132,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u160u80u80u80u80'+ArgSeparator+'i80',ClassFileName,'file','y');
+PrintStringInfo('d0d0d0d0d0'+ArgSeparator+'i80',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_sr595Setup';
@@ -6597,6 +7157,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u80u80u80u80u80u80u80u80u80u80'+ArgSeparator+'',ClassFileName,'file','y');
+PrintStringInfo('d0d0d0d0d0d0d0d0d0d0'+ArgSeparator+'',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_lcdCharDef';
@@ -6621,6 +7182,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u80u80u80u80u80u80u80u80u80u80u80u80u80'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('d0d0d0d0d0d0d0d0d0d0d0d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_lcdInit';
@@ -6762,6 +7324,83 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,E INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
//------------------------------------
+//---- Class MATRIX---------------------
+//------------------------------------
+ClassName = 'MATRIX';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+//Arguements specified: initial value, start time, time vector, ode function
+PrintStringInfo('NIN= 3',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(2).VAL',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(3).VAL',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2d0d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d2s0s0'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d2u160u160'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d2u80u80'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('z2d0d0'+ArgSeparator+'z2',ClassFileName,'file','y');
+PrintStringInfo('z2s0s0'+ArgSeparator+'z2',ClassFileName,'file','y');
+
+PrintStringInfo('s2d0d0'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('s2s0s0'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('s2u160u160'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('s2u80u80'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('u162'+ArgSeparator+'u162',ClassFileName,'file','y');
+PrintStringInfo('i162'+ArgSeparator+'i162',ClassFileName,'file','y');
+
+PrintStringInfo('u162d0d0'+ArgSeparator+'u162',ClassFileName,'file','y');
+PrintStringInfo('u162s0s0'+ArgSeparator+'u162',ClassFileName,'file','y');
+PrintStringInfo('u82g2'+ArgSeparator+'u82',ClassFileName,'file','y');
+PrintStringInfo('i82g2'+ArgSeparator+'i82',ClassFileName,'file','y');
+PrintStringInfo('u162g2'+ArgSeparator+'u162',ClassFileName,'file','y');
+PrintStringInfo('i162g2'+ArgSeparator+'i162',ClassFileName,'file','y');
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'matrix';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class NNZ---------------------
+//------------------------------------
+ClassName = 'NNZ';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+//Arguements specified: initial value, start time, time vector, ode function
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u16''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0'+ArgSeparator+'u160',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'u160',ClassFileName,'file','y');
+PrintStringInfo('s0'+ArgSeparator+'u160',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'u160',ClassFileName,'file','y');
+PrintStringInfo('z0'+ArgSeparator+'u160',ClassFileName,'file','y');
+PrintStringInfo('z2'+ArgSeparator+'u160',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'nnz';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
//---- Class TRIU ---------------------
//------------------------------------
ClassName = 'TRIU';
@@ -7756,6 +8395,315 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class SQROOT ---------------------
+//------------------------------------
+ClassName = 'SQROOT';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'sqroot';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+//------------------------------------
+//---- Class GIVENS ---------------------
+//------------------------------------
+ClassName = 'GIVENS';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''2''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''2''',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 2',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''2''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''2''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= ''2''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= ''1''',ClassFileName,'file','y');
+
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''2''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''2''',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 2',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''2''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''2''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= ''2''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= ''1''',ClassFileName,'file','y');
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'d2d2',ClassFileName,'file','y');
+PrintStringInfo('d0d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d0d0'+ArgSeparator+'d2d2',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'givens';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+//------------------------------------
+//---- Class HOUSEHOLDER---------------------
+//------------------------------------
+ClassName = 'HOUSEHOLDER';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d2d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'householder';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class FULLRF---------------------
+//------------------------------------
+ClassName = 'FULLRF';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 3',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(2)= ''1''',ClassFileName,'file','y');
+
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 3',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2'+ArgSeparator+'d2d2d0',ClassFileName,'file','y');
+PrintStringInfo('d2d0'+ArgSeparator+'d2d2d0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'fullrf';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class ROWCOMP ---------------------
+//------------------------------------
+ClassName = 'ROWCOMP';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 2',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= ''1''',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 2',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= ''1''',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 3',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 2',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= ''1''',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2'+ArgSeparator+'d2d0',ClassFileName,'file','y');
+PrintStringInfo('d2g2'+ArgSeparator+'d2d0',ClassFileName,'file','y');
+PrintStringInfo('d2g2d0'+ArgSeparator+'d2d0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'rowcomp';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class QR---------------------
+//------------------------------------
+ClassName = 'QR';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 2',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 3',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 2',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 3',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');;
+PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 4',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');;
+PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(2)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 4',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');;
+PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(2)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2'+ArgSeparator+'d2d2',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'d2d2d2',ClassFileName,'file','y');
+PrintStringInfo('d2g2'+ArgSeparator+'d2d2',ClassFileName,'file','y');
+PrintStringInfo('d2g2'+ArgSeparator+'d2d2d2',ClassFileName,'file','y');
+PrintStringInfo('d2d0'+ArgSeparator+'d2d2d0d2',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'d2d2d0d2',ClassFileName,'file','y');
+
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'qr';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
//------------------------------------
//---- Class svd ---------------------
//------------------------------------
@@ -7789,8 +8737,8 @@ PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y'); PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(1)',ClassFileName,'file','y');
PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
-PrintStringInfo('OUT(2).SZ(1)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
-PrintStringInfo('OUT(2).SZ(2)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
PrintStringInfo('OUT(3).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
PrintStringInfo('OUT(3).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
@@ -7819,12 +8767,42 @@ PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y'); PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(1)',ClassFileName,'file','y');
PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
-PrintStringInfo('OUT(2).SZ(1)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
-PrintStringInfo('OUT(2).SZ(2)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
PrintStringInfo('OUT(3).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
PrintStringInfo('OUT(3).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 4',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).SZ(2)= ''1''',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 4',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).TP= ''d''',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).SZ(2)= ''1''',ClassFileName,'file','y');
+
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
PrintStringInfo('d2g2'+ArgSeparator+'d2d2d2',ClassFileName,'file','y');
@@ -7832,6 +8810,8 @@ PrintStringInfo('d2'+ArgSeparator+'d2d2d2',ClassFileName,'file','y'); PrintStringInfo('z2'+ArgSeparator+'z2',ClassFileName,'file','y');
PrintStringInfo('z2g2'+ArgSeparator+'z2z2z2',ClassFileName,'file','y');
PrintStringInfo('z2'+ArgSeparator+'z2z2z2',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'d2d2d2d0',ClassFileName,'file','y');
+PrintStringInfo('d2d0'+ArgSeparator+'d2d2d2d0',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'svd';
@@ -7875,7 +8855,6 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,E INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
-
//------------------------------------
//---- Class SVA ---------------------
//------------------------------------
@@ -7901,7 +8880,7 @@ PrintStringInfo('NIN= 2',ClassFileName,'file','y'); PrintStringInfo('NOUT= 3',ClassFileName,'file','y');
PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
-PrintStringInfo('OUT(1).SZ(2)= FA_SZ_U_SVA(IN(1),IN(2).VAL)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
PrintStringInfo('OUT(2).SZ(1)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
PrintStringInfo('OUT(2).SZ(2)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
@@ -7919,6 +8898,7 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
//------------------------------------
//---- Class balanc ------------------
//------------------------------------
@@ -9715,7 +10695,7 @@ ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls); PrintStringInfo('NIN= 3',ClassFileName,'file','y');
PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
-PrintStringInfo('OUT(1).TP= IN(3).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''d''',ClassFileName,'file','y');
PrintStringInfo('OUT(1).SZ(1)= IN(3).SZ(1)',ClassFileName,'file','y');
PrintStringInfo('OUT(1).SZ(2)= IN(3).SZ(2)',ClassFileName,'file','y');
diff --git a/macros/cb_sci2c_gui.sci b/macros/cb_sci2c_gui.sci index 2267c6c..bf77c25 100644 --- a/macros/cb_sci2c_gui.sci +++ b/macros/cb_sci2c_gui.sci @@ -200,12 +200,17 @@ elseif get(gcbo, "tag")=="convertbtn" then // -*- DEBUG ONLY -*- - //mprintf("UserScilabMainFile = {%s}\n", UserScilabMainFile); - //mprintf("UserSciFilesPaths = {%s}\n", UserSciFilesPaths); - //mprintf("UserSciCodeMainDir = {%s}\n", UserSciCodeMainDir); - //mprintf("RunMode = {%s}\n", RunMode); - //mprintf("CopySciCodeIntoCCode = {%d}\n", bool2s(CopySciCodeIntoCCode)); - //mprintf("NativeBuild = {%s}\n", NativeBuild); + mprintf("UserScilabMainFile = {%s}\n", UserScilabMainFile); + mprintf("UserSciFilesPaths = {%s}\n", UserSciFilesPaths); + mprintf("UserSciCodeMainDir = {%s}\n", UserSciCodeMainDir); + mprintf("RunMode = {%s}\n", RunMode); + mprintf("CopySciCodeIntoCCode = {%d}\n", bool2s(CopySciCodeIntoCCode)); + mprintf("NativeBuild = {%s}\n", NativeBuild); + mprintf("Target = {%s}\n", Target); + mprintf("Board Name = {%s}\n", Board_name); +// disp("Variable Names:") +// disp(UserScilabMainFile, UserSciCodeMainDir, UserSciFilesPaths, RunMode, NativeBuild,Target,Board_name) +// disp("Done") scilab2c(UserScilabMainFile, UserSciCodeMainDir, UserSciFilesPaths, RunMode, NativeBuild,Target,Board_name); // // --- sci2c help --- diff --git a/macros/findDeps/Scilab2CDeps.sci b/macros/findDeps/Scilab2CDeps.sci index 8044e27..b1b75c7 100644 --- a/macros/findDeps/Scilab2CDeps.sci +++ b/macros/findDeps/Scilab2CDeps.sci @@ -7,16 +7,15 @@ // you should have received as part of this distribution. The terms // are also available at // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Edited by: Yash Pratap Singh Tomar - -function scilab2ccode = initDependecies() +function scilab2ccode = Scilab2CDeps() ///////////////////////////////// ////// AUXILIARY FUNCTIONS ////// ///////////////////////////////// - //abs scilab2ccode.deps.cabss=["ssqrts","sabss","creals","cimags"] scilab2ccode.deps.cabsa=["cabss"] @@ -26,8 +25,14 @@ scilab2ccode.deps.sabss=[] scilab2ccode.deps.sabsa=["sabss"] scilab2ccode.deps.zabss=["dsqrts","dabss","zreals","zimags"] scilab2ccode.deps.zabsa=["zabss"] - - +scilab2ccode.deps.u8absa=["u8abss"] +scilab2ccode.deps.u8abss=[] +scilab2ccode.deps.i8absa=["i8abss"] +scilab2ccode.deps.i8abss=[] +scilab2ccode.deps.u16absa=["u16abss"] +scilab2ccode.deps.u16abss=[] +scilab2ccode.deps.i16absa=["i16abss"] +scilab2ccode.deps.i16abss=[] //conj scilab2ccode.deps.cconjs=["FloatComplex","creals","cimags"] scilab2ccode.deps.cconja=["cconjs"] @@ -39,7 +44,24 @@ scilab2ccode.deps.cfinda=["creals","cimags"] scilab2ccode.deps.dfinda=[] scilab2ccode.deps.sfinda=[] scilab2ccode.deps.zfinda=["zreals","zimags"] - +scilab2ccode.deps.i8finda=[] +scilab2ccode.deps.i16finda=[] +scilab2ccode.deps.u8finda=[] +scilab2ccode.deps.u16finda=[] + +//float +scilab2ccode.deps.dfloats=[] +scilab2ccode.deps.dfloata=[] +scilab2ccode.deps.i8floats=[] +scilab2ccode.deps.i8floata=[] +scilab2ccode.deps.i16floats=[] +scilab2ccode.deps.i16floata=[] +scilab2ccode.deps.sfloats=[] +scilab2ccode.deps.sfloata=[] +scilab2ccode.deps.u8floats=[] +scilab2ccode.deps.u8floata=[] +scilab2ccode.deps.u16floats=[] +scilab2ccode.deps.u16floata=[] //find2d scilab2ccode.deps.cfind2da=["creals","cimags"] @@ -78,9 +100,25 @@ scilab2ccode.deps.zisnana=["zisnans"] scilab2ccode.deps.cpythags=["csqrts","cadds","cmuls"] scilab2ccode.deps.dpythags=["dsqrts"] scilab2ccode.deps.spythags=["ssqrts"] -scilab2ccode.deps.cpythags=["zsqrts","zadds","zmuls"] +scilab2ccode.deps.zpythags=["zsqrts","zadds","zmuls"] //rand +scilab2ccode.deps.cranda=["crands"] +scilab2ccode.deps.crands=["FloatComplex"] +scilab2ccode.deps.dranda=["drands"] +scilab2ccode.deps.drands=[] +scilab2ccode.deps.i8randa=["i8rands"] +scilab2ccode.deps.i8rands=[] +scilab2ccode.deps.i16randa=["i16rands"] +scilab2ccode.deps.i16rands=[] +scilab2ccode.deps.sranda=["srands"] +scilab2ccode.deps.srands=[] +scilab2ccode.deps.u8randa=["u8rands"] +scilab2ccode.deps.u8rands=[] +scilab2ccode.deps.u16randa=["u16rands"] +scilab2ccode.deps.u16rands=[] +scilab2ccode.deps.zranda=["drands","DoubleComplex","zreals",] +scilab2ccode.deps.zrands=["drands","DoubleComplex"] //sign scilab2ccode.deps.csigns=["FloatComplex","cabss","creals","cimags"] @@ -91,11 +129,54 @@ scilab2ccode.deps.dsigns=[] scilab2ccode.deps.dsigna=["ssigns"] scilab2ccode.deps.zsigns=["DoubleComplex","zabss","zreals","zimags"] scilab2ccode.deps.zsigna=["zsigns"] +scilab2ccode.deps.i8signa=["i8signs"] +scilab2ccode.deps.i8signs=[] +scilab2ccode.deps.i16signa=["i16signs"] +scilab2ccode.deps.i16signs=[] +scilab2ccode.deps.u8signa=["u8signs"] +scilab2ccode.deps.u8signs=[] +scilab2ccode.deps.u16signa=["u16signs"] +scilab2ccode.deps.u16signs=[] //size +scilab2ccode.deps.dallsizea=[] //type +///////////////////////////////// +///// CACSD ///////////// +//////////////////////////////// + +//lqe +scilab2ccode.deps.dlqea=["dtransposea","dlqra"] + +//lqr +scilab2ccode.deps.dlqra=["dtransposea","dmulma","dinverma","ddiffa","dschura","drdivma","dadda","deyea","dgschura"] + +//obscont +scilab2ccode.deps.dobsconta=["dmulma","dadda"] + +//syslin +scilab2ccode.deps.dsyslina=[] + +///////////////////////////////// +///////DIFFERENTIAL CALCULUS///// +///////////////////////////////// + +//diff +scilab2ccode.deps.ddiffca=[] +scilab2ccode.deps.i8diffca=[] +scilab2ccode.deps.i16diffca=[] +scilab2ccode.deps.sdiffca=[] +scilab2ccode.deps.u8diffca=[] +scilab2ccode.deps.u16diffca=[] + +//ode +scilab2ccode.deps.dodea=[] +scilab2ccode.deps.dodes=[] + + + ////////////////////////////////// ////// ELEMENTARY FUNCTIONS ////// @@ -111,6 +192,11 @@ scilab2ccode.deps.sacosa=["sacoss"] scilab2ccode.deps.zacoss=["DoubleComplex","dsqrts","dabss","dacoss","datans","dlogs","dlog1ps","zreals","zimags"] scilab2ccode.deps.zacosa=["zacoss"] +//acosd +scilab2ccode.deps.dacosda=["dacosds"] +scilab2ccode.deps.dacosds=[] +scilab2ccode.deps.sacosda=["sacosds"] +scilab2ccode.deps.sacosds=[] //acosh scilab2ccode.deps.cacoshs=["FloatComplex","cacoss","creals","cimags"] @@ -122,6 +208,76 @@ scilab2ccode.deps.sacosha=["sacoshs"] scilab2ccode.deps.zacoshs=["DoubleComplex","zacoss","zreals","zimags"] scilab2ccode.deps.zacosha=["zacoshs"] +//acot +scilab2ccode.deps.cacota=["cacots"] +scilab2ccode.deps.cacots=["FloatComplex","crdivs","catans"] +scilab2ccode.deps.dacota=["dacots"] +scilab2ccode.deps.dacots=[] +scilab2ccode.deps.sacota=["sacots"] +scilab2ccode.deps.sacots=[] +scilab2ccode.deps.zacota=["zacots"] +scilab2ccode.deps.zacots=["DoubleComplex","zrdivs","zatans"] + +//acotd +scilab2ccode.deps.dacotda=["dacotds"] +scilab2ccode.deps.dacotds=[] +scilab2ccode.deps.sacotda=["sacotds"] +scilab2ccode.deps.sacotds=[] + +//acoth +scilab2ccode.deps.cacotha=["cacoths"] +scilab2ccode.deps.cacoths=["FloatComplex","crdivs","catanhs"] +scilab2ccode.deps.dacotha=["dacoths"] +scilab2ccode.deps.dacoths=[] +scilab2ccode.deps.sacotha=["sacoths"] +scilab2ccode.deps.sacoths=[] +scilab2ccode.deps.zacotha=["zacoths"] +scilab2ccode.deps.zacoths=["DoubleComplex","zrdivs","zatanhs"] + +//acsc +scilab2ccode.deps.cacsca=["cacscs"] +scilab2ccode.deps.cacscs=["FloatComplex","crdivs","casins"] +scilab2ccode.deps.dacsca=["dacscs"] +scilab2ccode.deps.dacscs=[] +scilab2ccode.deps.sacsca=["sacscs"] +scilab2ccode.deps.sacscs=[] +scilab2ccode.deps.zacsca=["zacscs"] +scilab2ccode.deps.zacscs=["DoubleComplex","zrdivs","zasins"] + +//acscd +scilab2ccode.deps.dacscda=["dacscds"] +scilab2ccode.deps.dacscds=[] +scilab2ccode.deps.sacscda=["sacscds"] +scilab2ccode.deps.sacscds=[] + +//acsch +scilab2ccode.deps.cacsca=["cacscs"] +scilab2ccode.deps.cacscs=["FloatComplex","crdivs","cmuls"] +scilab2ccode.deps.dacscha=["dacschs"] +scilab2ccode.deps.dacschs=[] +scilab2ccode.deps.sacscha=["sacschs"] +scilab2ccode.deps.sacschs=[] +scilab2ccode.deps.zacsca=["zacscs"] +scilab2ccode.deps.zacscs=["zrdivs","DoubleComplex","zasins"] + +//asec +scilab2ccode.deps.daseca=["dasecs"] +scilab2ccode.deps.dasecs=[] +scilab2ccode.deps.saseca=["sasecs"] +scilab2ccode.deps.sasecs=[] + +//asecd +scilab2ccode.deps.dasecda=["dasecds"] +scilab2ccode.deps.dasecds=[] +scilab2ccode.deps.sasecda=["sasecds"] +scilab2ccode.deps.sasecds=[] + +//asech +scilab2ccode.deps.dasecha=["dasechs"] +scilab2ccode.deps.dasechs=[] +scilab2ccode.deps.sasecha=["sasechs"] +scilab2ccode.deps.sasechs=[] + //asin scilab2ccode.deps.casins=["FloatComplex","ssqrts","sabss","sasins","satans","slogs","slog1ps","dabss","creals","cimags"] scilab2ccode.deps.casina=["casins"] @@ -132,6 +288,13 @@ scilab2ccode.deps.sasina=["sasins"] scilab2ccode.deps.zasins=["DoubleComplex","dsqrts","dabss","dasins","datans","dlog1ps","dlogs","zreals","zimags"] scilab2ccode.deps.zasina=["zasins"] +//asind +scilab2ccode.deps.dasinda=["dasinds"] +scilab2ccode.deps.dasinds=[] +scilab2ccode.deps.sasinda=["sasinds"] +scilab2ccode.deps.sasinds=[] + + //asinh scilab2ccode.deps.casinhs=["FloatComplex","casins","creals","cimags"] scilab2ccode.deps.casinha=["casinhs"] @@ -160,6 +323,11 @@ scilab2ccode.deps.datan2a=["datan2s"] scilab2ccode.deps.satan2s=[] scilab2ccode.deps.satan2a=["satan2s"] +//atand +scilab2ccode.deps.datanda=["datands"] +scilab2ccode.deps.datands=[] +scilab2ccode.deps.satanda=["satands"] +scilab2ccode.deps.satands=[] //atanh scilab2ccode.deps.catanhs=["FloatComplex","creals","cimags","catans"] @@ -171,6 +339,55 @@ scilab2ccode.deps.satanha=["satanhs"] scilab2ccode.deps.zatanhs=["DoubleComplex","zreals","zimags","zatans"] scilab2ccode.deps.zatanha=["zatanhs"] +//bitand +scilab2ccode.deps.u8bitanda=["u8bitands"] +scilab2ccode.deps.u8bitands=[] +scilab2ccode.deps.u16bitanda=["u16bitands"] +scilab2ccode.deps.u16bitands=[] + +//bitcmp +scilab2ccode.deps.u8bitcmps=["u8bitcmps"] +scilab2ccode.deps.u8bitcmps=[] +scilab2ccode.deps.u16bitcmpa=["u16bitcmps"] +scilab2ccode.deps.u16bitcmps=[] + +//bitget +scilab2ccode.deps.u8bitgets=[] +scilab2ccode.deps.u16bitgets=[] + +//bitor +scilab2ccode.deps.u8bitora=["u8bitors"] +scilab2ccode.deps.u8bitors=[] +scilab2ccode.deps.u16bitora=["u16bitors"] +scilab2ccode.deps.u16bitors=[] + +//bitset +scilab2ccode.deps.u8bitsets=[] +scilab2ccode.deps.u16bitsets=[] + +//bitxor +scilab2ccode.deps.u8bitxora=["u8bitxors"] +scilab2ccode.deps.u8bitxors=[] +scilab2ccode.deps.u16bitxora=["u16bitxors"] +scilab2ccode.deps.u16bitxors=[] + +//ceil +scilab2ccode.deps.cceila=["cceils"] +scilab2ccode.deps.cceils=["creals","cimags","FloatComplex"] +scilab2ccode.deps.dceila=["dceils"] +scilab2ccode.deps.dceils=[] +scilab2ccode.deps.i8ceila=["i8ceils"] +scilab2ccode.deps.i8ceils=[] +scilab2ccode.deps.i16ceila=["i16ceils"] +scilab2ccode.deps.i16ceils=[] +scilab2ccode.deps.sceila=["sceils"] +scilab2ccode.deps.sceils=[] +scilab2ccode.deps.u8ceila=["u8ceils"] +scilab2ccode.deps.u8ceils=[] +scilab2ccode.deps.u16ceila=["u16ceils"] +scilab2ccode.deps.u16ceils=[] +scilab2ccode.deps.zceila=["zceils"] +scilab2ccode.deps.zceils=["zreals","zimags","DoubleComplex"] //cos scilab2ccode.deps.ccoss=["creals","cimags","FloatComplex","scoss","scoshs","ssins","ssinhs"] @@ -181,7 +398,14 @@ scilab2ccode.deps.scoss=[] scilab2ccode.deps.scosa=["scoss"] scilab2ccode.deps.zcoss=["zreals","zimags","DoubleComplex","dcoss","dcoshs","dsins","dsinhs"] scilab2ccode.deps.zcosa=["zcoss"] - +scilab2ccode.deps.i8cosa=["i8coss"] +scilab2ccode.deps.i8coss=[] +scilab2ccode.deps.i16cosa=["i16coss"] +scilab2ccode.deps.i16coss=[] +scilab2ccode.deps.u8cosa=["u8coss"] +scilab2ccode.deps.u8coss=[] +scilab2ccode.deps.u16cosa=["u16coss"] +scilab2ccode.deps.u16coss=[] //cosh scilab2ccode.deps.ccoshs=["ccoss","FloatComplex","creals","cimags"] @@ -192,6 +416,14 @@ scilab2ccode.deps.scoshs=["sexps","sabss"] scilab2ccode.deps.scosha=["scoshs"] scilab2ccode.deps.zcoshs=["zcoss","DoubleComplex","zreals","zimags"] scilab2ccode.deps.zcosha=["zcoshs"] +scilab2ccode.deps.i8cosha=["i8coshs"] +scilab2ccode.deps.i8coshs=["i8abss","i8exps"] +scilab2ccode.deps.i16cosha=["i16coshs"] +scilab2ccode.deps.i16coshs=["i16abss","i16exps"] +scilab2ccode.deps.u8cosha=["u8coshs"] +scilab2ccode.deps.u8coshs=["u8abss","u8exps"] +scilab2ccode.deps.u16cosha=["u16coshs"] +scilab2ccode.deps.u16coshs=["u16abss","u16exps"] //exp @@ -203,7 +435,14 @@ scilab2ccode.deps.sexps=[] scilab2ccode.deps.sexpa=["sexps"] scilab2ccode.deps.zexps=["zreals","zimags","DoubleComplex","dexps","dcoss","dsins"] scilab2ccode.deps.zexpa=["zexps"] - +scilab2ccode.deps.i8expa=["i8exps"] +scilab2ccode.deps.i8exps=[] +scilab2ccode.deps.i16expa=["i16exps"] +scilab2ccode.deps.i16exps=[] +scilab2ccode.deps.u8expa=["u8exps"] +scilab2ccode.deps.u8exps=[] +scilab2ccode.deps.u16expa=["u16exps"] +scilab2ccode.deps.u16exps=[] //exp10 scilab2ccode.deps.cexp10s=["cpows","FloatComplex"] @@ -215,6 +454,80 @@ scilab2ccode.deps.sexp10a=["sexp10s"] scilab2ccode.deps.zexp10s=["zpows","DoubleComplex"] scilab2ccode.deps.zexp10a=["zexp10s"] +//fix +scilab2ccode.deps.cfixa=["cfixs"] +scilab2ccode.deps.cfixs=["creals","cimags","FloatComplex"] +scilab2ccode.deps.dfixa=["dfixs"] +scilab2ccode.deps.dfixs=[] +scilab2ccode.deps.i8fixa=["i8fixs"] +scilab2ccode.deps.i8fixs=["i8floors","i8ceils"] +scilab2ccode.deps.i16fixa=["i16fixs"] +scilab2ccode.deps.i16fixs=["i16floors","i16ceils"] +scilab2ccode.deps.sfixa=["sfixs"] +scilab2ccode.deps.sfixs=[] +scilab2ccode.deps.u8fixa=["u8fixs"] +scilab2ccode.deps.u8fixs=["u8floors","u8ceils"] +scilab2ccode.deps.u16fixa=["u16fixs"] +scilab2ccode.deps.u16fixs=["u16floors","u16ceils"] +scilab2ccode.deps.zfixa=["zfixs"] +scilab2ccode.deps.zfixs=["zreals","zimags","DoubleComplex"] + +//floor +scilab2ccode.deps.cfloora=["cfloors"] +scilab2ccode.deps.cfloors=["creals","cimags","FloatComplex"] +scilab2ccode.deps.dfloora=["dfloors"] +scilab2ccode.deps.dfloors=[] +scilab2ccode.deps.i8floora=["i8floors"] +scilab2ccode.deps.i8floors=[] +scilab2ccode.deps.i16floora=["i16floors"] +scilab2ccode.deps.i16floors=[] +scilab2ccode.deps.sfloora=["sfloors"] +scilab2ccode.deps.sfloors=[] +scilab2ccode.deps.u8floora=["u8floors"] +scilab2ccode.deps.u8floors=[] +scilab2ccode.deps.u16floora=["u16floors"] +scilab2ccode.deps.u16floors=[] +scilab2ccode.deps.zfloors=["zfloors"] +scilab2ccode.deps.zfloors=["zreals","zimags","DoubleComplex"] + +//int +scilab2ccode.deps.cinta=["cfixa"] +scilab2ccode.deps.cints=["cfixs"] +scilab2ccode.deps.dinta=["dfixa"] +scilab2ccode.deps.dints=["dfixs"] +scilab2ccode.deps.sinta=["sfixa"] +scilab2ccode.deps.sints=["sfixs"] +scilab2ccode.deps.zinta=["zfixa"] +scilab2ccode.deps.zints=["zfixs"] + +//int8 +scilab2ccode.deps.dint8a=["dint8s"] +scilab2ccode.deps.dint8s=[] +scilab2ccode.deps.i16int8a=["i16int8s"] +scilab2ccode.deps.i16int8s=[] +scilab2ccode.deps.sint8a=["sint8s"] +scilab2ccode.deps.sint8s=[] +scilab2ccode.deps.u8int8a=["u8int8s"] +scilab2ccode.deps.u8int8s=[] +scilab2ccode.deps.u16int8a=["u16int8s"] +scilab2ccode.deps.u16int8s=[] + +//int16 +scilab2ccode.deps.dint16a=["dint16s"] +scilab2ccode.deps.dint16s=[] +scilab2ccode.deps.i8int16a=["i8int16s"] +scilab2ccode.deps.i8int16s=[] +scilab2ccode.deps.sint16a=["sint16s"] +scilab2ccode.deps.sint16s=[] +scilab2ccode.deps.u8int16a=["u8int16s"] +scilab2ccode.deps.u8int16s=[] +scilab2ccode.deps.u16int16a=["u16int16s"] +scilab2ccode.deps.u16int16s=[] + +//linspace +scilab2ccode.deps.dlinspacea=[] +scilab2ccode.deps.dlinspaces=[] + //lnp1m1 scilab2ccode.deps.dlnp1m1s=["dabss"] @@ -253,6 +566,9 @@ scilab2ccode.deps.slog10a=["slog10s"] scilab2ccode.deps.zlog10s=["zlogs","DoubleComplex","zreals","zimags","dlogs"] scilab2ccode.deps.zlog10a=["zlog10s"] +//logspace +scilab2ccode.deps.dlogspacea=[] +scilab2ccode.deps.dlogspaces=[] //pow scilab2ccode.deps.cpows=["cexps","cmuls","clogs"] @@ -263,7 +579,32 @@ scilab2ccode.deps.spows=[] scilab2ccode.deps.spowa=["spows"] scilab2ccode.deps.zpows=["zexps","zmuls","zlogs"] scilab2ccode.deps.zpowa=["zpows"] - +scilab2ccode.deps.i8powa=["i8pows"] +scilab2ccode.deps.i8pows=[] +scilab2ccode.deps.i16powa=["i16pows"] +scilab2ccode.deps.i16pows=[] +scilab2ccode.deps.u8powa=["u8pows"] +scilab2ccode.deps.u8pows=[] +scilab2ccode.deps.u16powa=["u16pows"] +scilab2ccode.deps.u16pows=[] + +//round +scilab2ccode.deps.crounda=["crounds"] +scilab2ccode.deps.crounds=["creals","cimags","FloatComplex"] +scilab2ccode.deps.drounda=["drounds"] +scilab2ccode.deps.drounds=[] +scilab2ccode.deps.i8rounda=["i8rounds"] +scilab2ccode.deps.i8rounds=[] +scilab2ccode.deps.i16rounda=["i16rounds"] +scilab2ccode.deps.i16rounds=[] +scilab2ccode.deps.srounda=["srounds"] +scilab2ccode.deps.srounds=[] +scilab2ccode.deps.u8rounda=["u8rounds"] +scilab2ccode.deps.u8rounds=[] +scilab2ccode.deps.u16rounda=["u16rounds"] +scilab2ccode.deps.u16rounds=[] +scilab2ccode.deps.zrounda=["zrounds"] +scilab2ccode.deps.zrounds=["zreals","zimags","DoubleComplex"] //sin scilab2ccode.deps.csins=["creals","cimags","FloatComplex","ssins","scoshs","scoss","ssinhs"] @@ -274,6 +615,14 @@ scilab2ccode.deps.ssins=[] scilab2ccode.deps.ssina=["ssins"] scilab2ccode.deps.zsins=["zreals","zimags","DoubleComplex","dsins","dcoshs","dcoss","dsinhs"] scilab2ccode.deps.zsina=["zsins"] +scilab2ccode.deps.i8sina=["i8sins"] +scilab2ccode.deps.i8sins=[] +scilab2ccode.deps.i16sina=["i16sins"] +scilab2ccode.deps.i16sins=[] +scilab2ccode.deps.u8sina=["u8sins"] +scilab2ccode.deps.u8sins=[] +scilab2ccode.deps.u16sina=["u16sins"] +scilab2ccode.deps.u16sins=[] //sinh @@ -285,6 +634,14 @@ scilab2ccode.deps.ssinhs=[] scilab2ccode.deps.ssinha=["ssinhs"] scilab2ccode.deps.zsinhs=["zreals","zimags","zsins","DoubleComplex"] scilab2ccode.deps.zsinha=["zsinhs"] +scilab2ccode.deps.i8sinha=["i8sinhs"] +scilab2ccode.deps.i8sinhs=[] +scilab2ccode.deps.i16sinha=["i16sinhs"] +scilab2ccode.deps.i16sinhs=[] +scilab2ccode.deps.u8sinha=["u8sinhs"] +scilab2ccode.deps.u8sinhs=[] +scilab2ccode.deps.u16sinha=["u16sinhs"] +scilab2ccode.deps.u16sinhs=[] //sqrt @@ -307,6 +664,14 @@ scilab2ccode.deps.stans=[] scilab2ccode.deps.stana=["stans"] scilab2ccode.deps.ztans=["dlogs","dsqrts","zreals","zimags","dcoss","dsinhs","dsins","dabss","DoubleComplex"] scilab2ccode.deps.ztana=["ztans"] +scilab2ccode.deps.i8tana=["i8tans"] +scilab2ccode.deps.i8tans=[] +scilab2ccode.deps.i16tana=["i16tans"] +scilab2ccode.deps.i16tans=[] +scilab2ccode.deps.u8tana=["u8tans"] +scilab2ccode.deps.u8tans=[] +scilab2ccode.deps.u16tana=["u16tans"] +scilab2ccode.deps.u16tans=[] //tanh @@ -318,13 +683,285 @@ scilab2ccode.deps.stanhs=[] scilab2ccode.deps.stanha=["stanhs"] scilab2ccode.deps.ztanhs=["zreals","zimags","ztans","DoubleComplex"] scilab2ccode.deps.ztanha=["ztanhs"] +scilab2ccode.deps.i8tanha=["i8tanhs"] +scilab2ccode.deps.i8tanhs=[] +scilab2ccode.deps.i16tanha=["i16tanhs"] +scilab2ccode.deps.i16tanhs=[] +scilab2ccode.deps.u8tanha=["u8tanhs"] +scilab2ccode.deps.u8tanhs=[] +scilab2ccode.deps.u16tanha=["u16tanhs"] +scilab2ccode.deps.u16tanhs=[] + +//uint8 +scilab2ccode.deps.duint8a=["duint8s"] +scilab2ccode.deps.duint8s=[] +scilab2ccode.deps.i8uint8a=["i8uint8s"] +scilab2ccode.deps.i8uint8s=[] +scilab2ccode.deps.i16uint8a=["i16uint8s"] +scilab2ccode.deps.i16uint8s=[] +scilab2ccode.deps.suint8a=["suint8s"] +scilab2ccode.deps.suint8s=[] +scilab2ccode.deps.u16uint8a=["u16uint8s"] +scilab2ccode.deps.u16uint8s=[] + +//uint16 +scilab2ccode.deps.duint16a=["duint16s"] +scilab2ccode.deps.duint16s=[] +scilab2ccode.deps.i8uint16a=["i8uint16s"] +scilab2ccode.deps.i8uint16s=[] +scilab2ccode.deps.i16uint16a=["i16uint16s"] +scilab2ccode.deps.i16uint16s=[] +scilab2ccode.deps.suint16a=["suint16s"] +scilab2ccode.deps.suint16s=[] +scilab2ccode.deps.u8uint16a=["u8uint16s"] +scilab2ccode.deps.u8uint16s=[] + +//////DISCRETE_MATHEMATICS///////// + +//factor +scilab2ccode.deps.dfactors=[] +scilab2ccode.deps.sfactors=[] + +//factorial +scilab2ccode.deps.dfactoriala=["dfactorials"] +scilab2ccode.deps.dfactorials=[] +scilab2ccode.deps.sfactoriala=["dfactorials"] +scilab2ccode.deps.sfactorials=[] + +//primes +scilab2ccode.deps.dprimess=[] +scilab2ccode.deps.sprimess=[] + + +////////RADIX_CONVERSION//////// + +//base2dec +scilab2ccode.deps.dbase2decs=[] +scilab2ccode.deps.gbase2decs=[] + +//bin2dec +scilab2ccode.deps.dbin2deca=["dbin2decs"] +scilab2ccode.deps.dbin2decs=[] +scilab2ccode.deps.i8bin2deca=["i8bin2decs"] +scilab2ccode.deps.i8bin2decs=[] +scilab2ccode.deps.i16bin2deca=["i16bin2decs"] +scilab2ccode.deps.i16bin2decs=[] +scilab2ccode.deps.u8bin2deca=["u8bin2decs"] +scilab2ccode.deps.u8bin2decs=[] +scilab2ccode.deps.u16bin2deca=["u16bin2decs"] +scilab2ccode.deps.u16bin2decs=[] + +//dec2base +scilab2ccode.deps.ddec2basea=["ddec2bases"] +scilab2ccode.deps.ddec2bases=[] +scilab2ccode.deps.sdec2basea=["sdec2bases"] +scilab2ccode.deps.sdec2bases=[] + +//dec2bin +scilab2ccode.deps.ddec2bina=["ddec2bins"] +scilab2ccode.deps.ddec2bins=[] +scilab2ccode.deps.i8dec2bina=["i8dec2bins"] +scilab2ccode.deps.i8dec2bins=[] +scilab2ccode.deps.i16dec2bina=["i16dec2bins"] +scilab2ccode.deps.i16dec2bins=[] +scilab2ccode.deps.u8dec2bina=["u8dec2bins"] +scilab2ccode.deps.u8dec2bins=[] +scilab2ccode.deps.u16dec2bina=["u16dec2bins"] +scilab2ccode.deps.u16dec2bins=[] + +//dec2hex +scilab2ccode.deps.ddec2hexa=["ddec2hexs"] +scilab2ccode.deps.ddec2hexs=[] +scilab2ccode.deps.i8dec2hexa=["i8dec2hexs"] +scilab2ccode.deps.i8dec2hexs=[] +scilab2ccode.deps.i16dec2hexa=["i16dec2hexs"] +scilab2ccode.deps.i16dec2hexs=[] +scilab2ccode.deps.u8dec2hexa=["u8dec2hexs"] +scilab2ccode.deps.u8dec2hexs=[] +scilab2ccode.deps.u16dec2hexa=["u16dec2hexs"] +scilab2ccode.deps.u16dec2hexs=[] + +//dec2oct +scilab2ccode.deps.ddec2octa=["ddec2octs"] +scilab2ccode.deps.ddec2octs=[] +scilab2ccode.deps.i8dec2octa=["i8dec2octs"] +scilab2ccode.deps.i8dec2octs=[] +scilab2ccode.deps.i16dec2octa=["i16dec2octs"] +scilab2ccode.deps.i16dec2octs=[] +scilab2ccode.deps.u8dec2octa=["u8dec2octs"] +scilab2ccode.deps.u8dec2octs=[] +scilab2ccode.deps.u16dec2octs=["u16dec2octs"] +scilab2ccode.deps.u16dec2octs=[] + +//hex2dec +scilab2ccode.deps.dhex2decs=[] +scilab2ccode.deps.ghex2decs=[] + +//oct2dec +scilab2ccode.deps.doct2deca=["doct2decs"] +scilab2ccode.deps.doct2decs=[] +scilab2ccode.deps.i8oct2deca=["i8oct2decs"] +scilab2ccode.deps.i8oct2decs=[] +scilab2ccode.deps.i16oct2deca=["i16oct2decs"] +scilab2ccode.deps.i16oct2decs=[] +scilab2ccode.deps.u8oct2deca=["u8oct2decs"] +scilab2ccode.deps.u8oct2decs=[] +scilab2ccode.deps.u16oct2deca=["u16oct2decs"] +scilab2ccode.deps.u16oct2decs=[] + +//////////Trigonometry///////// + +//cosd +scilab2ccode.deps.dcosda=["dcosds"] +scilab2ccode.deps.dcosds=[] +scilab2ccode.deps.scosda=["scosds"] +scilab2ccode.deps.scosds=[] + +//cotd +scilab2ccode.deps.dcotda=["dcotds"] +scilab2ccode.deps.dcotds=[] +scilab2ccode.deps.scotda=["scotds"] +scilab2ccode.deps.scotds=[] + +//coth +scilab2ccode.deps.ccotha=["ccoths"] +scilab2ccode.deps.ccoths=["ctanhs","FloatComplex","crdivs"] +scilab2ccode.deps.dcotha=[] +scilab2ccode.deps.dcoths=[] +scilab2ccode.deps.scotha=[] +scilab2ccode.deps.scoths=[] +scilab2ccode.deps.zcotha=["zcoths"] +scilab2ccode.deps.zcoths=["zrdivs","DoubleComplex","ztanhs"] + +//csc +scilab2ccode.deps.ccsca=["ccscs"] +scilab2ccode.deps.ccscs=["csins","FloatComplex","crdivs"] +scilab2ccode.deps.dcsca=["dcscs"] +scilab2ccode.deps.dcscs=[] +scilab2ccode.deps.scsca=["scscs"] +scilab2ccode.deps.scscs=[] +scilab2ccode.deps.zcsca=["zcscs"] +scilab2ccode.deps.zcscs=["DoubleComplex","zrdivs","dsins","dcoshs","dcoss","dsinhs","zreals","zimags"] + +//cscd +scilab2ccode.deps.ccscda=["ccscds"] +scilab2ccode.deps.ccscds=["csins","FloatComplex","crdivs"] +scilab2ccode.deps.dcscda=["dcscds"] +scilab2ccode.deps.dcscds=[] +scilab2ccode.deps.scscda=["scscds"] +scilab2ccode.deps.scscds=[] +scilab2ccode.deps.zcscda=["zcscds"] +scilab2ccode.deps.zcscds=["zrdivs","DoubleComplex","zsins"] + +//csch +scilab2ccode.deps.ccscha=["ccschs"] +scilab2ccode.deps.ccschs=["csinhs","FloatComplex","crdivs"] +scilab2ccode.deps.dcscha=["dcschs"] +scilab2ccode.deps.dcschs=[] +scilab2ccode.deps.scscha=["scschs"] +scilab2ccode.deps.scschs=[] +scilab2ccode.deps.zcscha=["zcschs"] +scilab2ccode.deps.zcschs=["zrdivs","DoubleComplex","zsinhs"] + +//sec +scilab2ccode.deps.cseca=["csecs"] +scilab2ccode.deps.csecs=["ccoss","FloatComplex","crdivs"] +scilab2ccode.deps.dseca=[] +scilab2ccode.deps.dsecs=[] +scilab2ccode.deps.sseca=["ssecs"] +scilab2ccode.deps.ssecs=[] +scilab2ccode.deps.zseca=["zsecs"] +scilab2ccode.deps.zsecs=["zrdivs","DoubleComplex","zcoss"] + +//secd +scilab2ccode.deps.dsecda=["dsecds"] +scilab2ccode.deps.dsecds=[] +scilab2ccode.deps.ssecda=["ssecds"] +scilab2ccode.deps.ssecds=[] + +//sech +scilab2ccode.deps.csecha=["csechs"] +scilab2ccode.deps.ccoths=["ccoshs","FloatComplex","crdivs"] +scilab2ccode.deps.dsecha=["dsechs"] +scilab2ccode.deps.dsechs=[] +scilab2ccode.deps.ssecha=["ssechs"] +scilab2ccode.deps.ssechs=[] +scilab2ccode.deps.zsecha=["zsechs"] +scilab2ccode.deps.zsechs=["zrdivs","DoubleComplex","zcoshs"] + +/////////////////////////////// +////// FILES ////// +/////////////////////////////// + + +//mclose +scilab2ccode.deps.mclose=[] + + +//mopen +scilab2ccode.deps.mopen=[] + + +//mput +scilab2ccode.deps.dmputa=[] +scilab2ccode.deps.dmputs=[] +scilab2ccode.deps.i8mputa=[] +scilab2ccode.deps.i8mputs=[] +scilab2ccode.deps.i16mputa=[] +scilab2ccode.deps.i16mputs=[] +scilab2ccode.deps.smputa=[] +scilab2ccode.deps.smputs=[] +scilab2ccode.deps.u8mputa=[] +scilab2ccode.deps.u8mputs=[] +scilab2ccode.deps.u16mputa=[] +scilab2ccode.deps.u16mputs=[] /////////////////////////////// +////// IMPLICITLIST ////// +/////////////////////////////// + +scilab2ccode.deps.cimplicitLists=["simplicitLists"] +scilab2ccode.deps.dimplicitLists=[] +scilab2ccode.deps.simplicitLists=[] +scilab2ccode.deps.zimplicitLists=["dimplicitLists"] + +/////////////////////////////// +/////// LINEARALGEBRA /////// +/////////////////////////////// + +//balanc +scilab2ccode.deps.dbalanca=["deyea"] + +//rcond +scilab2ccode.deps.drconda=[] + +//schur +scilab2ccode.deps.dgschura=[] +scilab2ccode.deps.dschura=[] + +/////////////////////////////// ////// MATRIX OPERATIONS ////// /////////////////////////////// +//cat +scilab2ccode.deps.ccata=[] +scilab2ccode.deps.ccats=[] +scilab2ccode.deps.dcata=[] +scilab2ccode.deps.dcatS=[] +scilab2ccode.deps.scata=[] +scilab2ccode.deps.scats=[] +scilab2ccode.deps.zcata=[] +scilab2ccode.deps.zcats=[] +scilab2ccode.deps.i8cata=[] +scilab2ccode.deps.i8cats=[] +scilab2ccode.deps.i16cata=[] +scilab2ccode.deps.i16catS=[] +scilab2ccode.deps.u8cata=[] +scilab2ccode.deps.u8cats=[] +scilab2ccode.deps.u16cata=[] +scilab2ccode.deps.u16cats=[] //OpRc scilab2ccode.deps.crowcats=[] @@ -355,14 +992,87 @@ scilab2ccode.deps.dchola=[] scilab2ccode.deps.schols=["ssqrts"] scilab2ccode.deps.schola=["ssqrts"] scilab2ccode.deps.zchola=["DoubleComplex","zreals","zimags","zdiffs","zmuls","zrdivs","zsqrts"] - +//cumprod +scilab2ccode.deps.dcolumncumproda=[] +scilab2ccode.deps.dcumproda=[] +scilab2ccode.deps.drowcumproda=[] +scilab2ccode.deps.i8columncumproda=[] +scilab2ccode.deps.i8cumproda=[] +scilab2ccode.deps.i8rowcumproda=[] +scilab2ccode.deps.i16columncumproda=[] +scilab2ccode.deps.i16cumproda=[] +scilab2ccode.deps.i16rowcumproda=[] +scilab2ccode.deps.scolumncumproda=[] +scilab2ccode.deps.scumproda=[] +scilab2ccode.deps.srowcumproda=[] +scilab2ccode.deps.u8columncumproda=[] +scilab2ccode.deps.u8cumproda=[] +scilab2ccode.deps.u8rowcumproda=[] +scilab2ccode.deps.u16columncumproda=[] +scilab2ccode.deps.u16cumproda=[] +scilab2ccode.deps.u16rowcumproda=[] + +//cumcum +scilab2ccode.deps.dcolumncumsuma=[] +scilab2ccode.deps.dcumsuma=[] +scilab2ccode.deps.drowcumsuma=[] +scilab2ccode.deps.i8columncumsuma=[] +scilab2ccode.deps.i8cumsuma=[] +scilab2ccode.deps.i8rowcumsuma=[] +scilab2ccode.deps.i16columncumsuma=[] +scilab2ccode.deps.i16cumsuma=[] +scilab2ccode.deps.i16rowcumsuma=[] +scilab2ccode.deps.scolumncumsuma=[] +scilab2ccode.deps.scumsuma=[] +scilab2ccode.deps.srowcumsuma=[] +scilab2ccode.deps.u8columncumsuma=[] +scilab2ccode.deps.u8cumsuma=[] +scilab2ccode.deps.u8rowcumsuma=[] +scilab2ccode.deps.u16columncumsuma=[] +scilab2ccode.deps.u16cumsuma=[] +scilab2ccode.deps.u16rowcumsuma=[] //determ scilab2ccode.deps.cdeterma=["cdiffs","FloatComplex","cmuls","cadds","DoubleComplex","creals","cimags","zreals","zimags","zmuls","crdivs"] scilab2ccode.deps.ddeterma=[] scilab2ccode.deps.sdeterma=[] scilab2ccode.deps.zdeterma=["zdiffs","zmuls","DoubleComplex","zadds","zreals","zimags","zrdivs"] - +scilab2ccode.deps.i8determa=[] +scilab2ccode.deps.i16determa=[] +scilab2ccode.deps.u8determa=[] +scilab2ccode.deps.u16determa=[] + +//diag +scilab2ccode.deps.ddiaga=[] +scilab2ccode.deps.ddiagexa=[] +scilab2ccode.deps.ddiagexs=[] +scilab2ccode.deps.ddiagina=[] +scilab2ccode.deps.ddiagins=[] +scilab2ccode.deps.ddiags=[] +scilab2ccode.deps.i8diags=[] +scilab2ccode.deps.i8diagexa=[] +scilab2ccode.deps.i8diagexs=[] +scilab2ccode.deps.i8diagina=[] +scilab2ccode.deps.i8diagins=[] +scilab2ccode.deps.i8diags=[] +scilab2ccode.deps.i16diaga=[] +scilab2ccode.deps.i16diags=[] +scilab2ccode.deps.i16diagexa=[] +scilab2ccode.deps.i16diagexs=[] +scilab2ccode.deps.i16diagina=[] +scilab2ccode.deps.i16diagins=[] +scilab2ccode.deps.u8diaga=[] +scilab2ccode.deps.u8diags=[] +scilab2ccode.deps.u8diagexa=[] +scilab2ccode.deps.u8diagexs=[] +scilab2ccode.deps.u8diagina=[] +scilab2ccode.deps.u8diagins=[] +scilab2ccode.deps.u16diaga=[] +scilab2ccode.deps.u16diags=[] +scilab2ccode.deps.u16diagexa=[] +scilab2ccode.deps.u16diagexs=[] +scilab2ccode.deps.u16diagina=[] +scilab2ccode.deps.u16diagins=[] //dist scilab2ccode.deps.cdists=["spows","creals","cimags","ssqrts"] @@ -374,6 +1084,28 @@ scilab2ccode.deps.sdista=["spows","ssqrts"] scilab2ccode.deps.zdists=["dpows","zreals","zimags","dsqrts"] scilab2ccode.deps.zdista=["dpows","zreals","zimags","dsqrts"] +//division +scilab2ccode.deps.crdivcsv=["crdivv"] +scilab2ccode.deps.crdivscv=["crdivv"] +scilab2ccode.deps.crdivv=["crdivma","FloatComplex"] +scilab2ccode.deps.drdivv=["drdivma"] +scilab2ccode.deps.i8rdivma=["dtransposea"] +scilab2ccode.deps.i8ldivma=[] +scilab2ccode.deps.i8rdivv=["i8rdivma"] +scilab2ccode.deps.i16ldivma=[] +scilab2ccode.deps.i16rdivma=["dtransposea"] +scilab2ccode.deps.i16rdivv=["i16rdivma"] +scilab2ccode.deps.srdivv=["srdivma"] +scilab2ccode.deps.u8rdivma=["dtransposea"] +scilab2ccode.deps.u8ldivma=[] +scilab2ccode.deps.u8rdivv=["u8rdivma"] +scilab2ccode.deps.u16ldivma=[] +scilab2ccode.deps.u16rdivma=["dtransposea"] +scilab2ccode.deps.u16rdivv=["u16rdivma"] +scilab2ccode.deps.zrdivdzv=["dzerosa","zrdivv"] +scilab2ccode.deps.zrdivv=["zrdivma","DoubleComplex"] +scilab2ccode.deps.zrdivzdv=["dzerosa","zrdivv"] + //OpSlash scilab2ccode.deps.crdivma=["DoubleComplex","creals","cimags","zrdivma","FloatComplex","zreals","zimags"] @@ -401,7 +1133,10 @@ scilab2ccode.deps.ceyea= ["FloatComplex"] scilab2ccode.deps.deyea= [] scilab2ccode.deps.seyea= [] scilab2ccode.deps.zeyea= ["DoubleComplex"] - +scilab2ccode.deps.i8eyea= [] +scilab2ccode.deps.i16eyea= [] +scilab2ccode.deps.u8eyea= [] +scilab2ccode.deps.u16eyea= [] //fill scilab2ccode.deps.cfilla=["conesa","cmuls"] @@ -409,10 +1144,18 @@ scilab2ccode.deps.dfilla=["donesa"] scilab2ccode.deps.sfilla=["sonesa"] scilab2ccode.deps.zfilla=["zonesa","zmuls"] +//flipdim +scilab2ccode.deps.dflipdima=[] +scilab2ccode.deps.i8flipdima=[] +scilab2ccode.deps.i16flipdima=[] +scilab2ccode.deps.sflipdima=[] +scilab2ccode.deps.u8flipdima=[] +scilab2ccode.deps.u16flipdima=[] + +//hilb +scilab2ccode.deps.dhilba=[] +scilab2ccode.deps.shilba=[] -//hilbert -scilab2ccode.deps.dhilberta=[] -scilab2ccode.deps.shilberta=[] //infinite norm scilab2ccode.deps.cinfnorma=["spythags","creals","cimags"] @@ -426,10 +1169,19 @@ scilab2ccode.deps.cinverma=["DoubleComplex","creals","cimags","zinverma","FloatC scilab2ccode.deps.dinverma=[] scilab2ccode.deps.sinverma=["dinverma"] scilab2ccode.deps.zinverma=[] +scilab2ccode.deps.i8inverma=[] +scilab2ccode.deps.i16inverma=[] +scilab2ccode.deps.u8inverma=[] +scilab2ccode.deps.u16inverma=[] //jmat +scilab2ccode.deps.djmata=[] +scilab2ccode.deps.sjmata=[] +//kron +scilab2ccode.deps.dkrona=[] +scilab2ccode.deps.skrona=[] //logm scilab2ccode.deps.clogma=["DoubleComplex","creals","cimags","zlogma","FloatComplex","zreals","zimags"] @@ -447,21 +1199,58 @@ scilab2ccode.deps.smagns=[] scilab2ccode.deps.smagna=["smagns"] scilab2ccode.deps.zmagns=["zreals","zimags","dsqrts"] scilab2ccode.deps.zmagna=["zmagns"] - +scilab2ccode.deps.i8magna=[] +scilab2ccode.deps.i8magns=["i8abss"] +scilab2ccode.deps.i16magna=["dmagns"] +scilab2ccode.deps.i16magns=["i16abss"] +scilab2ccode.deps.u8magna=["dmagns"] +scilab2ccode.deps.u8magns=["u8abss"] +scilab2ccode.deps.u16magna=["dmagns"] +scilab2ccode.deps.u16magns=["u16abss"] //OpStar scilab2ccode.deps.cmulma=["FloatComplex","cadds","cmuls"] scilab2ccode.deps.dmulma=[] scilab2ccode.deps.smulma=[] scilab2ccode.deps.zmulma=["zreala","zimaga","DoubleComplex","zadds","zmuls"] +scilab2ccode.deps.i8mulma=[] +scilab2ccode.deps.i16mulma=[] +scilab2ccode.deps.u8mulma=[] +scilab2ccode.deps.u16mulma=[] +//norm +scilab2ccode.deps.dnorma=[] +scilab2ccode.deps.dnormv=[] +scilab2ccode.deps.snorma=[] +scilab2ccode.deps.snormv=[] //ones scilab2ccode.deps.conesa=["FloatComplex"] scilab2ccode.deps.donesa=[] scilab2ccode.deps.sonesa=[] scilab2ccode.deps.zonesa=["DoubleComplex"] - +scilab2ccode.deps.i8onesa=[] +scilab2ccode.deps.i16onesa=[] +scilab2ccode.deps.u8onesa=[] +scilab2ccode.deps.u16onesa=[] + +//powm +scilab2ccode.deps.cpowma=["creals","cimags","cspec2a","cpows","cmulma","ctransposea","cconja","cinverma"] +scilab2ccode.deps.dpowma=["dzerosa","zspec2a","zpows","zmulma","ztransposea","zconja","zinverma","zreals","DoubleComplex"] +scilab2ccode.deps.spowma=["szerosa","cspec2a","cpows","FloatComplex","cmulma","ctransposea","cconja","cinverma","creals"] +scilab2ccode.deps.zpowma=["zreals","zimags","zspec2a","zpows","zmulma","ztransposea","zconja","zinverma"] + +//spec +scilab2ccode.deps.cspeca=["DoubleComplex","creals","cimags","zspeca","FloatComplex","zreals","zimags"] +scilab2ccode.deps.dspeca=[] +scilab2ccode.deps.sspeca=["dspeca"] +scilab2ccode.deps.zspeca=["DoubleComplex","zreals","zimags","zconjs","dzerosa"] + +//spec2 +scilab2ccode.deps.cspec2a=["DoubleComplex","creals","cimags","zspec2a","FloatComplex","zreals","zimags"] +scilab2ccode.deps.dspec2a=["dzerosa"] +scilab2ccode.deps.sspec2a=["dspec2a"] +scilab2ccode.deps.zspec2a=["DoubleComplex","zreals","zimags","dzerosa"] //Squared Magnitude scilab2ccode.deps.csquMagns=["creals","cimags"] @@ -479,6 +1268,10 @@ scilab2ccode.deps.ctracea=["creals","cimags","FloatComplex"] scilab2ccode.deps.dtracea=[] scilab2ccode.deps.stracea=[] scilab2ccode.deps.ztracea=["zreals","zimags","DoubleComplex"] +scilab2ccode.deps.i8tracea=[] +scilab2ccode.deps.i16tracea=[] +scilab2ccode.deps.u8tracea=[] +scilab2ccode.deps.u16tracea=[] //transpose @@ -486,16 +1279,44 @@ scilab2ccode.deps.ctransposea=["creals","cimags","FloatComplex"] scilab2ccode.deps.dtransposea=[] scilab2ccode.deps.stransposea=[] scilab2ccode.deps.ztransposea=["zreals","zimags","DoubleComplex"] - - - +scilab2ccode.deps.i8transposea=[] +scilab2ccode.deps.i16transposea=[] +scilab2ccode.deps.u8transposea=[] +scilab2ccode.deps.u16transposea=[] + +//tril +scilab2ccode.deps.dtrila=[] +scilab2ccode.deps.i8trila=[] +scilab2ccode.deps.i16trila=[] +scilab2ccode.deps.strila=[] +scilab2ccode.deps.u8trila=[] +scilab2ccode.deps.u16trila=[] + +//triu +scilab2ccode.deps.dtriua=[] +scilab2ccode.deps.i8triua=[] +scilab2ccode.deps.i16triua=[] +scilab2ccode.deps.striua=[] +scilab2ccode.deps.u8triua=[] +scilab2ccode.deps.u16triua=[] + +//zeros +scilab2ccode.deps.czerosa=["FloatComplex"] +scilab2ccode.deps.dzerosa=[] +scilab2ccode.deps.dzerosh=[] +scilab2ccode.deps.i8zerosa=[] +scilab2ccode.deps.i16zerosa=[] +scilab2ccode.deps.szerosa=[] +scilab2ccode.deps.u8zerosa=[] +scilab2ccode.deps.u16zerosa=[] +scilab2ccode.deps.zzerosa=["DoubleComplex"] //////////////////////// ////// OPERATIONS ////// //////////////////////// -//OpPlus +//addition scilab2ccode.deps.cadds=["creals","cimags","FloatComplex"] scilab2ccode.deps.cadda=["cadds"] scilab2ccode.deps.dadds=[] @@ -504,9 +1325,17 @@ scilab2ccode.deps.sadds=[] scilab2ccode.deps.sadda=["sadds"] scilab2ccode.deps.zadds=["zreals","zimags","DoubleComplex"] scilab2ccode.deps.zadda=["zadds"] +scilab2ccode.deps.i8adda=["i8adds"] +scilab2ccode.deps.i8adds=[] +scilab2ccode.deps.i16adda=["i16adds"] +scilab2ccode.deps.i16adds=[] +scilab2ccode.deps.u8adda=["u8adds"] +scilab2ccode.deps.u8adds=[] +scilab2ccode.deps.u16adda=["u16adds"] +scilab2ccode.deps.u16adds=[] -//OpDotSlash/OpSlash +//division scilab2ccode.deps.crdivs=["FloatComplex"] scilab2ccode.deps.crdiva=["crdivs"] scilab2ccode.deps.drdivs=[] @@ -515,9 +1344,6 @@ scilab2ccode.deps.srdivs=[] scilab2ccode.deps.srdiva=["srdivs"] scilab2ccode.deps.zrdivs=["DoubleComplex"] scilab2ccode.deps.zrdiva=["zrdivs"] - - -//OpBackSlash scilab2ccode.deps.cldivs=["cmuls","cconjs","creals","cimags","FloatComplex","crdivs"] scilab2ccode.deps.cldiva=["cldivs"] scilab2ccode.deps.dldivs=[] @@ -526,9 +1352,24 @@ scilab2ccode.deps.sldivs=[] scilab2ccode.deps.sldiva=["scldivs"] scilab2ccode.deps.zldivs=["zmuls","zconjs","zreals","zimags","DoubleComplex","zrdivs"] scilab2ccode.deps.zldiva=["zldivs"] - - -//OpStar/OpDotStar +scilab2ccode.deps.i8ldiva=["i8ldivs"] +scilab2ccode.deps.i8ldivs=[] +scilab2ccode.deps.i8rdiva=["i8rdivs"] +scilab2ccode.deps.i8rdivs=[] +scilab2ccode.deps.i16ldiva=["i16ldivs"] +scilab2ccode.deps.i16ldivs=[] +scilab2ccode.deps.i16rdiva=["i16rdivs"] +scilab2ccode.deps.i16rdivs=[] +scilab2ccode.deps.u8ldiva=["u8ldivs"] +scilab2ccode.deps.u8ldivs=[] +scilab2ccode.deps.u8rdiva=["u8rdivs"] +scilab2ccode.deps.u8rdivs=[] +scilab2ccode.deps.u16ldiva=["u16ldivs"] +scilab2ccode.deps.u16ldivs=[] +scilab2ccode.deps.u16rdiva=["u16rdivs"] +scilab2ccode.deps.u16rdivs=[] + +//multiplication scilab2ccode.deps.cmuls=["FloatComplex"] scilab2ccode.deps.cmula=["cmuls"] scilab2ccode.deps.dmuls=[] @@ -537,9 +1378,28 @@ scilab2ccode.deps.smuls=[] scilab2ccode.deps.smula=["smuls"] scilab2ccode.deps.zmuls=["DoubleComplex"] scilab2ccode.deps.zmula=["zmuls"] - - -//OpMinus +scilab2ccode.deps.cmulcsv=["cmulv"] +scilab2ccode.deps.cmulscv=["cmulv"] +scilab2ccode.deps.cmulv=["cadds"] +scilab2ccode.deps.dmulv=["dmuls"] +scilab2ccode.deps.i8muls=[] +scilab2ccode.deps.i8mula=["i8muls"] +scilab2ccode.deps.i8mulv=["i8muls"] +scilab2ccode.deps.i16muls=[] +scilab2ccode.deps.i16mula=["i16muls"] +scilab2ccode.deps.i16mulv=["i16muls"] +scilab2ccode.deps.smulv=["smuls"] +scilab2ccode.deps.u8muls=[] +scilab2ccode.deps.u8mula=["u8muls"] +scilab2ccode.deps.u8mulv=["u8muls"] +scilab2ccode.deps.u16muls=[] +scilab2ccode.deps.u16mula=["u16muls"] +scilab2ccode.deps.u16mulv=["u16muls"] +scilab2ccode.deps.zmuldzv=["dzerosa","zmulv"] +scilab2ccode.deps.zmulzdv=["dzerosa","zmulv"] +scilab2ccode.deps.zmulv=["zadds"] + +//subtraction scilab2ccode.deps.cdiffs=["creals","cimags","FloatComplex"] scilab2ccode.deps.cdiffa=["cdiffs"] scilab2ccode.deps.ddiffs=[] @@ -548,6 +1408,14 @@ scilab2ccode.deps.sdiffs=[] scilab2ccode.deps.sdiffa=["sdiffs"] scilab2ccode.deps.zdiffs=["zreals","zimags","DoubleComplex"] scilab2ccode.deps.zdiffa=["zdiffs"] +scilab2ccode.deps.i8diffs=[] +scilab2ccode.deps.i8diffa=["i8diffs"] +scilab2ccode.deps.i16diffa=["i16diffs"] +scilab2ccode.deps.i16diffs=[] +scilab2ccode.deps.u8diffa=["u8diffs"] +scilab2ccode.deps.u8diffs=[] +scilab2ccode.deps.u16diffa=["u16diffs"] +scilab2ccode.deps.u16diffs=[] /////////////////////////////// @@ -581,12 +1449,13 @@ scilab2ccode.deps.cfftma=["DoubleComplex","creals","cimags","zfftma","FloatCompl scilab2ccode.deps.dfft2=["dfftbi"] scilab2ccode.deps.dfftbi=["dfftmx"] scilab2ccode.deps.dfftmx=[] +scilab2ccode.deps.dfftma=["dzerosa","zfftma","zreala"] scilab2ccode.deps.fft842=["r2tx","r4tx","r8tx","DoubleComplex","zreals","zimags"] scilab2ccode.deps.r2tx=["zadds","zdiffs","DoubleComplex","zreals","zimags"] scilab2ccode.deps.r4tx=["zadds","zdiffs","DoubleComplex","zreals","zimags"] scilab2ccode.deps.r8tx=["zadds","zdiffs","DoubleComplex","zreals","zimags"] scilab2ccode.deps.zfftma=["zreala","zimaga","fft842","dfft2","DoubleComplexMatrix"] - +scilab2ccode.deps.sfftma=["szerosa","cfftma","creala"] //hilbert scilab2ccode.deps.dhilberts=[] @@ -594,6 +1463,20 @@ scilab2ccode.deps.dhilberta=["DoubleComplex","zfftma","zmuls","zifftma"] scilab2ccode.deps.shilberts=[] scilab2ccode.deps.shilberta=["FloatComplex","cfftma","cmuls","cifftma"] +//fftshift +scilab2ccode.deps.ccolumnfftshifta=[] +scilab2ccode.deps.cfftshifta=["crowfftshifta","ccolumnfftshifta"] +scilab2ccode.deps.crowfftshifta=[] +scilab2ccode.deps.dcolumnfftshifta=[] +scilab2ccode.deps.dfftshifta=["drowfftshifta","dcolumnfftshifta"] +scilab2ccode.deps.drowfftshifta=[] +scilab2ccode.deps.scolumnfftshifta=[] +scilab2ccode.deps.sfftshifta=["srowfftshifta","scolumnfftshifta"] +scilab2ccode.deps.srowfftshifta=[] +scilab2ccode.deps.zcolumnfftshifta=[] +scilab2ccode.deps.zfftshifta=["zrowfftshifta","zcolumnfftshifta"] +scilab2ccode.deps.zrowfftshifta=[] + //ifft scilab2ccode.deps.cifftma=["DoubleComplex","creals","cimags","zifftma","FloatComplex","zreals","zimags"] @@ -605,6 +1488,19 @@ scilab2ccode.deps.ir2tx=["zadds","zdiffs","DoubleComplex","zreals","zimags"] scilab2ccode.deps.ir4tx=["zadds","zdiffs","DoubleComplex","zreals","zimags"] scilab2ccode.deps.ir8tx=["zadds","zdiffs","DoubleComplex","zreals","zimags"] scilab2ccode.deps.zifftma=["zreala","zimaga","ifft842","difft2","DoubleComplexMatrix"] +scilab2ccode.deps.diffbi_lavraie=[] +scilab2ccode.deps.difftma=["dzerosa","zifftma","zreala"] +scilab2ccode.deps.sifftma=["szerosa","cifftma","creala"] + +//lev +scilab2ccode.deps.cleva=["crdivs","FloatComplex","creals","cimags","cmuls","cconjs","cdiffs","cadds"] +scilab2ccode.deps.cleva2=["crdivs","FloatComplex","creals","cimags","cmuls","cconjs","cdiffs","cadds"] +scilab2ccode.deps.dleva=[] +scilab2ccode.deps.dleva2=[] +scilab2ccode.deps.sleva=[] +scilab2ccode.deps.sleva2=[] +scilab2ccode.deps.zleva=["zrdivs","DoubleComplex","zreals","zimags","zmuls","zdiffs","zconjs","zadds"] +scilab2ccode.deps.zleva2=["zrdivs","DoubleComplex","zreals","zimags","zmuls","zdiffs","zconjs","zadds"] //levin @@ -630,7 +1526,7 @@ scilab2ccode.deps.slevinmul2=[] scilab2ccode.deps.sdecalage=[] scilab2ccode.deps.slevinsub=[] scilab2ccode.deps.slevinsig=[] - +scilab2ccode.deps.levinUtils=[] //lpc2cep scilab2ccode.deps.clpc2cepa=["cfftma","clogma","cifftma"] @@ -643,6 +1539,25 @@ scilab2ccode.deps.zlpc2cepa=["zfftma","zlogma","zifftma"] ////// STATISTIC FUNCTIONS ////// ///////////////////////////////// +//max +scilab2ccode.deps.dcolumnmaxa=[] +scilab2ccode.deps.dmaxa=[] +scilab2ccode.deps.drowmaxa=[] +scilab2ccode.deps.i8columnmaxa=[] +scilab2ccode.deps.i8maxa=[] +scilab2ccode.deps.i8rowmaxa=[] +scilab2ccode.deps.i16columnmaxa=[] +scilab2ccode.deps.i16maxa=[] +scilab2ccode.deps.i16rowmaxa=[] +scilab2ccode.deps.scolumnmaxa=[] +scilab2ccode.deps.smaxa=[] +scilab2ccode.deps.srowmaxa=[] +scilab2ccode.deps.u8columnmaxa=[] +scilab2ccode.deps.u8maxa=[] +scilab2ccode.deps.u8rowmaxa=[] +scilab2ccode.deps.u16columnmaxa=[] +scilab2ccode.deps.u16maxa=[] +scilab2ccode.deps.u16rowmaxa=[] //mean scilab2ccode.deps.cmeana=["FloatComplex","cadds","creals","cimags"] @@ -658,7 +1573,43 @@ scilab2ccode.deps.drowmeana=["drowsuma"] scilab2ccode.deps.srowmeana=["srowsuma"] scilab2ccode.deps.zrowmeana=["zrowsuma","zrdivs","DoubleComplex"] - +//meanf +scilab2ccode.deps.cmeanfa=["FloatComplex","cadds","crdivs"] +scilab2ccode.deps.dmeanfa=[] +scilab2ccode.deps.smeanfa=[] +scilab2ccode.deps.zmeanfa=["DoubleComplex","zadds","zmuls","zrdivs"] +scilab2ccode.deps.ccolumnmeanfa=["cadds","cmuls","FloatComplex","crdivs"] +scilab2ccode.deps.dcolumnmeanfa=[] +scilab2ccode.deps.scolumnmeanfa=[] +scilab2ccode.deps.zcolumnmeanfa=["zmuls","zrdivs","DoubleComplex","zadds"] +scilab2ccode.deps.crowmeanfa=["cmuls","crdivs","FloatComplex","cadds"] +scilab2ccode.deps.drowmeanfa=["drowsuma"] +scilab2ccode.deps.srowmeanfa=[] +scilab2ccode.deps.zrowmeanfa=["zmuls","zrdivs","DoubleComplex","zadds"] +scilab2ccode.deps.cmeanfcs=["szerosa","cmeanfa"] +scilab2ccode.deps.cmeanfsc=["szerosa","cmeanfa"] +scilab2ccode.deps.zmeanfdz=["dzerosa","zmeanfa"] +scilab2ccode.deps.zmeanfzd=["dzerosa","zmeanfa"] + +//min +scilab2ccode.deps.dcolumnmina=[] +scilab2ccode.deps.dmina=[] +scilab2ccode.deps.drowmina=[] +scilab2ccode.deps.i8columnmina=[] +scilab2ccode.deps.i8mina=[] +scilab2ccode.deps.i8rowmina=[] +scilab2ccode.deps.i16columnmina=[] +scilab2ccode.deps.i16mina=[] +scilab2ccode.deps.i16rowmina=[] +scilab2ccode.deps.scolumnmina=[] +scilab2ccode.deps.smina=[] +scilab2ccode.deps.srowmina=[] +scilab2ccode.deps.u8columnmina=[] +scilab2ccode.deps.u8mina=[] +scilab2ccode.deps.u8rowmina=[] +scilab2ccode.deps.u16columnmina=[] +scilab2ccode.deps.u16mina=[] +scilab2ccode.deps.u16rowmina=[] //prod scilab2ccode.deps.cproda=["cmuls"] scilab2ccode.deps.dproda=[] @@ -673,6 +1624,30 @@ scilab2ccode.deps.drowproda=[] scilab2ccode.deps.srowproda=[] scilab2ccode.deps.zrowproda=["zmuls"] +//stdevf +scilab2ccode.deps.ccolumnstdevfa=["FloatComplex","cpows","cdiffs","cmuls","cadds","sabss","creals","cimags","crdivs","csqrts"] +scilab2ccode.deps.cstdevfa=["FloatComplex","cmeanfa","cpows","cmuls","cadds","crdivs","csqrts","cdiffs"] +scilab2ccode.deps.crowstdevfa=["FloatComplex","crowmeanfa","cpows","cdiffs","cmuls","cadds""sabss","creals","cimags","crdivs","csqrts"] +scilab2ccode.deps.cstdevfcs=["FloatComplex","cmeanfcs","cpows","cdiffs","cmuls","cadds","creals","cimags","csqrts"] +scilab2ccode.deps.cstdevfsc=["szerosa","cstdevfa"] +scilab2ccode.deps.dcolumnstdevfa=["dcolumnmeanfa","dpows","dsqrts"] +scilab2ccode.deps.dstdevfa=[] +scilab2ccode.deps.drowstdevfa=[] +scilab2ccode.deps.i8columnmina=[] +scilab2ccode.deps.i8mina=[] +scilab2ccode.deps.i8rowmina=[] +scilab2ccode.deps.i16columnmina=[] +scilab2ccode.deps.i16mina=[] +scilab2ccode.deps.i16rowmina=[] +scilab2ccode.deps.scolumnmina=[] +scilab2ccode.deps.smina=[] +scilab2ccode.deps.srowmina=[] +scilab2ccode.deps.u8columnmina=[] +scilab2ccode.deps.u8mina=[] +scilab2ccode.deps.u8rowmina=[] +scilab2ccode.deps.u16columnmina=[] +scilab2ccode.deps.u16mina=[] +scilab2ccode.deps.u16rowmina=[] //sum scilab2ccode.deps.csuma=["cadds"] @@ -687,7 +1662,18 @@ scilab2ccode.deps.crowsuma=["cadds"] scilab2ccode.deps.drowsuma=[] scilab2ccode.deps.srowsuma=[] scilab2ccode.deps.zrowsuma=["zadds"] - +scilab2ccode.deps.i8suma=["i8adds"] +scilab2ccode.deps.i8columnsuma=["i8adds"] +scilab2ccode.deps.i8rowsuma=["i8adds"] +scilab2ccode.deps.i16suma=["i16adds"] +scilab2ccode.deps.i16columnsuma=["i16adds"] +scilab2ccode.deps.i16rowsuma=["i16adds"] +scilab2ccode.deps.u8suma=["u8adds"] +scilab2ccode.deps.U8columnsuma=["u8adds"] +scilab2ccode.deps.u8rowsuma=["u8adds"] +scilab2ccode.deps.u16suma=["u16adds"] +scilab2ccode.deps.u16columnsuma=["u16adds"] +scilab2ccode.deps.u16rowsuma=["u16adds"] //variance scilab2ccode.deps.cvariancea=["FloatComplex","cmeana","cdiffs","cadds","cpows","creals","cimags","crdivs"] @@ -703,11 +1689,27 @@ scilab2ccode.deps.drowvariancea=["dtransposea","dvariancea"] scilab2ccode.deps.srowvariancea=["stransposea","svariancea"] scilab2ccode.deps.zrowvariancea=["ztransposea","DoubleComplex","zreals","zimags","zvariancea"] +//variancef +scilab2ccode.deps.cvariancefa=["FloatComplex","cmeanfa","cdiffs","cadds","cpows","cmuls","crdivs"] +scilab2ccode.deps.dvariancefa=["dmeanfa","dpows"] +scilab2ccode.deps.svariancefa=["smeanfa","spows"] +scilab2ccode.deps.zvariancefa=["DoubleComplex","zmeanfa","zdiffs","zadds","zpows","zrdivs"] +scilab2ccode.deps.ccolumnvariancefa=["cvariancefa","ctransposea"] +scilab2ccode.deps.dcolumnvariancefa=["dvariancefa","dtransposea"] +scilab2ccode.deps.scolumnvariancefa=["scolumnmeanfa","spows"] +scilab2ccode.deps.zcolumnvariancefa=["zvariancefa","ztransposea"] +scilab2ccode.deps.crowvariancefa=["cvariancefa"] +scilab2ccode.deps.drowvariancefa=["dvariancefa"] +scilab2ccode.deps.srowvariancefa=["svariancefa"] +scilab2ccode.deps.zrowvariancefa=["zvariancefa"] + //////////////////// ////// STRING ////// //////////////////// +//convstr +scilab2ccode.deps.gconvstrs=[] //disp scilab2ccode.deps.cdisps=["creals","cimags"] @@ -718,12 +1720,49 @@ scilab2ccode.deps.sdisps=[] scilab2ccode.deps.sdispa=[] scilab2ccode.deps.zdisps=["zreals","zimags"] scilab2ccode.deps.zdispa=["zreals","zimags"] - +scilab2ccode.deps.ddisph=[] +scilab2ccode.deps.i8disps=[] +scilab2ccode.deps.i8dispa=[] +scilab2ccode.deps.i16disps=[] +scilab2ccode.deps.i16dispa=[] +scilab2ccode.deps.u8disps=[] +scilab2ccode.deps.u8dispa=[] +scilab2ccode.deps.u16disps=[] +scilab2ccode.deps.u16dispa=[] + +//string +scilab2ccode.deps.cstringa=["cstrings"] +scilab2ccode.deps.cstrings=["creals","cimags"] +scilab2ccode.deps.dstringa=["dstrings"] +scilab2ccode.deps.dstrings=[] +scilab2ccode.deps.i8stringa=["i8strings"] +scilab2ccode.deps.i8strings=[] +scilab2ccode.deps.i16stringa=["i16strings"] +scilab2ccode.deps.i16strings=[] +scilab2ccode.deps.sstringa=["sstrings"] +scilab2ccode.deps.sstrings=[] +scilab2ccode.deps.u8stringa=["u8strings"] +scilab2ccode.deps.u8strings=[] +scilab2ccode.deps.u16stringa=["u16strings"] +scilab2ccode.deps.u16strings=[] +scilab2ccode.deps.zstringa=["zstrings"] +scilab2ccode.deps.zstrings=[] + +//strrchr +scilab2ccode.deps.gstrrchra=[] + +//strrev +scilab2ccode.deps.gstrreva=[] + +//strsubst +scilab2ccode.deps.gstrsubsta=[] /////////////////// ////// TYPES ////// /////////////////// +scilab2ccode.deps.floatComplex=["creals","cimags","FloatComplex","cisreals","cisimags"] +scilab2ccode.deps.doubleComplex=["zreals","zimags","DoubleComplex","zisreals","zisimags"] //floatComplex scilab2ccode.deps.creals=[] @@ -746,4 +1785,24 @@ scilab2ccode.deps.DoubleComplexMatrix=["DoubleComplex"] scilab2ccode.deps.zisreals=["zimags"] scilab2ccode.deps.zisimags=["zreals"] +//Arduino Functions +scilab2ccode.deps.u8cmd_analog_ins=["duint16a","duint16s","i8uint16a","i8uint16s","i16uint16a","i16uint16s","suint16a","suint16s","u8uint16a","u8uint16s"] +scilab2ccode.deps.u8cmd_analog_in_volts=["dfloats","dfloata","i8floats","i8floata","i16floats","i16floata","sfloats","sfloata","u8floats","u8floata","u16floats","u16floata"] +scilab2ccode.deps.u8cmd_analog_outs=[] +scilab2ccode.deps.u8cmd_analog_out_volts=[] +scilab2ccode.deps.u8cmd_dcmotor_releases=[] +scilab2ccode.deps.u8cmd_dcmotor_runs=[] +scilab2ccode.deps.u8cmd_dcmotor_setups=[] +scilab2ccode.deps.u8cmd_digital_ins=["duint8a","duint8s","i8uint8a","i8uint8s","i16uint8a","i16uint8s","suint8a","suint8s","u16uint8a","u16uint8s"] +scilab2ccode.deps.u8cmd_digital_outs=[] +scilab2ccode.deps.u8cmd_i2c_devs=["duint8a","duint8s","i8uint8a","i8uint8s","i16uint8a","i16uint8s","suint8a","suint8s","u16uint8a","u16uint8s"] +scilab2ccode.deps.u8cmd_i2c_reads=[] +scilab2ccode.deps.u8cmd_i2c_read_registers=[] +scilab2ccode.deps.u8cmd_i2c_writes=[] +scilab2ccode.deps.u8cmd_i2c_write_registers=[] +scilab2ccode.deps.u8cmd_servo_attach=[] +scilab2ccode.deps.u8cmd_servo_move=[] +scilab2ccode.deps.u8cmd_servo_detach=[] +scilab2ccode.deps.u16sleeps=[] + endfunction diff --git a/macros/findDeps/getAllHeaders.sci b/macros/findDeps/getAllHeaders.sci index 0435976..90b80df 100644 --- a/macros/findDeps/getAllHeaders.sci +++ b/macros/findDeps/getAllHeaders.sci @@ -60,18 +60,21 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/matrixOperations/includes/logm.h" "src/c/matrixOperations/includes/ones.h" "src/c/matrixOperations/includes/matrixSquaredMagnitude.h" - "src/c/linearAlgebra/includes/spec.h" "src/c/matrixOperations/includes/matrixTranspose.h" "src/c/matrixOperations/includes/determ.h" "src/c/matrixOperations/includes/matrixMultiplication.h" "src/c/matrixOperations/includes/diag.h" "src/c/matrixOperations/includes/cumsum.h" + "src/c/matrixOperations/includes/matrix.h" + "src/c/matrixOperations/includes/nnz.h" "src/c/matrixOperations/includes/cumprod.h" "src/c/matrixOperations/includes/triu.h" "src/c/matrixOperations/includes/tril.h" "src/c/matrixOperations/includes/kron.h" "src/c/matrixOperations/includes/flipdim.h" "src/c/matrixOperations/includes/norm.h" + "src/c/matrixOperations/includes/toeplitz.h" + "src/c/matrixOperations/includes/cross.h" "src/c/interpolation/includes/interp1.h" "src/c/elementaryFunctions/includes/nextpow2.h" "src/c/elementaryFunctions/includes/gcd.h" @@ -127,11 +130,23 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/elementaryFunctions/includes/asec.h" "src/c/elementaryFunctions/includes/asecd.h" "src/c/elementaryFunctions/includes/asech.h" + "src/c/elementaryFunctions/includes/isrow.h" + "src/c/elementaryFunctions/includes/nthroot.h" + "src/c/elementaryFunctions/includes/pmodulo.h" + "src/c/elementaryFunctions/includes/nanmax.h" + "src/c/elementaryFunctions/includes/issquare.h" + "src/c/elementaryFunctions/includes/isscalar.h" + "src/c/elementaryFunctions/includes/isvector.h" + "src/c/elementaryFunctions/includes/iscolumn.h" + "src/c/elementaryFunctions/includes/ismatrix.h" "src/c/elementaryFunctions/includes/asind.h" "src/c/elementaryFunctions/includes/atand.h" + "src/c/elementaryFunctions/includes/isequal.h" "src/c/statisticsFunctions/includes/variance.h" "src/c/statisticsFunctions/includes/sum.h" "src/c/statisticsFunctions/includes/mean.h" + "src/c/statisticsFunctions/includes/median.h" + "src/c/statisticsFunctions/includes/mad.h" "src/c/statisticsFunctions/includes/meanf.h" "src/c/statisticsFunctions/includes/stdevf.h" "src/c/statisticsFunctions/includes/prod.h" @@ -216,18 +231,27 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/elementaryFunctions/includes/gcd.h" "src/c/elementaryFunctions/includes/lcm.h" "src/c/elementaryFunctions/includes/sinc.h" + "src/c/specialFunctions/includes/erf.h" + "src/c/specialFunctions/includes/erfc.h" + "src/c/specialFunctions/includes/erfcx.h" + "src/c/specialFunctions/includes/erfinv.h" "src/c/CACSD/includes/syslin.h" "src/c/CACSD/includes/lqr.h" "src/c/CACSD/includes/lqe.h" "src/c/CACSD/includes/obscont.h" - "src/c/linearAlgebra/includes/sva.h" - "src/c/linearAlgebra/includes/svd.h" "src/c/linearAlgebra/includes/schur.h" "src/c/linearAlgebra/includes/balanc.h" "src/c/linearAlgebra/includes/svd.h" - "src/c/linearAlgebra/includes/hess.h" - "src/c/linearAlgebra/includes/sva.h" - "src/c/linearAlgebra/includes/rcond.h"]; + "src/c/linearAlgebra/includes/hess.h" + "src/c/linearAlgebra/includes/sva.h" + "src/c/linearAlgebra/includes/sqroot.h" + "src/c/linearAlgebra/includes/givens.h" + "src/c/linearAlgebra/includes/householder.h" + "src/c/linearAlgebra/includes/fullrf.h" + "src/c/linearAlgebra/includes/rowcomp.h" + "src/c/linearAlgebra/includes/rcond.h" + "src/c/linearAlgebra/includes/qr.h" + "src/c/linearAlgebra/includes/spec.h"]; //Header files required for "Arduino" output diff --git a/macros/findDeps/getAllInterfaces.sci b/macros/findDeps/getAllInterfaces.sci index e629779..4982900 100644 --- a/macros/findDeps/getAllInterfaces.sci +++ b/macros/findDeps/getAllInterfaces.sci @@ -32,7 +32,6 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/type/int_real.h" "src/c/matrixOperations/interfaces/int_vmagn.h" "src/c/matrixOperations/interfaces/int_ones.h" - "src/c/linearAlgebra/interfaces/int_spec.h" "src/c/matrixOperations/interfaces/int_cat.h" "src/c/matrixOperations/interfaces/int_zeros.h" "src/c/matrixOperations/interfaces/int_OpBackSlash.h" @@ -54,6 +53,8 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/matrixOperations/interfaces/int_expm.h" "src/c/matrixOperations/interfaces/int_diag.h" "src/c/matrixOperations/interfaces/int_cumsum.h" + "src/c/matrixOperations/interfaces/int_matrix.h" + "src/c/matrixOperations/interfaces/int_nnz.h" "src/c/matrixOperations/interfaces/int_cumprod.h" "src/c/matrixOperations/interfaces/int_triu.h" "src/c/matrixOperations/interfaces/int_tril.h" @@ -61,6 +62,8 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/matrixOperations/interfaces/int_flipdim.h" "src/c/matrixOperations/interfaces/int_permute.h" "src/c/matrixOperations/interfaces/int_norm.h" + "src/c/matrixOperations/interfaces/int_toeplitz.h" + "src/c/matrixOperations/interfaces/int_cross.h" "src/c/interpolation/interfaces/int_interp1.h" "src/c/elementaryFunctions/interfaces/int_nextpow2.h" "src/c/elementaryFunctions/interfaces/int_gcd.h" @@ -98,6 +101,15 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/elementaryFunctions/interfaces/int_bitset.h" "src/c/elementaryFunctions/interfaces/int_bitget.h" "src/c/elementaryFunctions/interfaces/int_linspace.h" + "src/c/elementaryFunctions/interfaces/int_isrow.h" + "src/c/elementaryFunctions/interfaces/int_nthroot.h" + "src/c/elementaryFunctions/interfaces/int_pmodulo.h" + "src/c/elementaryFunctions/interfaces/int_nanmax.h" + "src/c/elementaryFunctions/interfaces/int_issquare.h" + "src/c/elementaryFunctions/interfaces/int_isscalar.h" + "src/c/elementaryFunctions/interfaces/int_isvector.h" + "src/c/elementaryFunctions/interfaces/int_iscolumn.h" + "src/c/elementaryFunctions/interfaces/int_ismatrix.h" "src/c/elementaryFunctions/interfaces/int_logspace.h" "src/c/elementaryFunctions/interfaces/int_cosh.h" "src/c/elementaryFunctions/interfaces/int_uint8.h" @@ -120,7 +132,10 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/elementaryFunctions/interfaces/int_atand.h" "src/c/elementaryFunctions/interfaces/int_gcd.h" "src/c/elementaryFunctions/interfaces/int_lcm.h" + "src/c/elementaryFunctions/interfaces/int_isequal.h" "src/c/statisticsFunctions/interfaces/int_mean.h" + "src/c/statisticsFunctions/interfaces/int_median.h" + "src/c/statisticsFunctions/interfaces/int_mad.h" "src/c/statisticsFunctions/interfaces/int_meanf.h" "src/c/statisticsFunctions/interfaces/int_stdevf.h" "src/c/statisticsFunctions/interfaces/int_prod.h" @@ -211,17 +226,26 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/elementaryFunctions/interfaces/int_primes.h" "src/c/elementaryFunctions/interfaces/int_factor.h" "src/c/elementaryFunctions/interfaces/int_sinc.h" + "src/c/specialFunctions/interfaces/int_erf.h" + "src/c/specialFunctions/interfaces/int_erfc.h" + "src/c/specialFunctions/interfaces/int_erfcx.h" + "src/c/specialFunctions/interfaces/int_erfinv.h" "src/c/CACSD/interfaces/int_syslin.h" "src/c/CACSD/interfaces/int_lqr.h" "src/c/CACSD/interfaces/int_lqe.h" "src/c/CACSD/interfaces/int_obscont.h" - "src/c/linearAlgebra/interfaces/int_sva.h" - "src/c/linearAlgebra/interfaces/int_svd.h" + "src/c/linearAlgebra/interfaces/int_spec.h" "src/c/linearAlgebra/interfaces/int_schur.h" "src/c/linearAlgebra/interfaces/int_balanc.h" "src/c/linearAlgebra/interfaces/int_svd.h" + "src/c/linearAlgebra/interfaces/int_sqroot.h" "src/c/linearAlgebra/interfaces/int_hess.h" - "src/c/linearAlgebra/interfaces/int_sva.h" + "src/c/linearAlgebra/interfaces/int_sva.h" + "src/c/linearAlgebra/interfaces/int_givens.h" + "src/c/linearAlgebra/interfaces/int_householder.h" + "src/c/linearAlgebra/interfaces/int_fullrf.h" + "src/c/linearAlgebra/interfaces/int_rowcomp.h" + "src/c/linearAlgebra/interfaces/int_qr.h"; "src/c/linearAlgebra/interfaces/int_rcond.h"]; diff --git a/macros/findDeps/getAllSources.sci b/macros/findDeps/getAllSources.sci index 0891aef..cbb0a1e 100644 --- a/macros/findDeps/getAllSources.sci +++ b/macros/findDeps/getAllSources.sci @@ -10,7 +10,7 @@ // // -function allSources = getAllSources(SharedInfo) +function allSources = getAllSources(SharedInfo,BuildTool) Target = SharedInfo.Target; //Files common to types of output format @@ -155,18 +155,10 @@ function allSources = getAllSources(SharedInfo) "src/c/matrixOperations/powm/spowma.c" "src/c/matrixOperations/powm/zpowma.c" "src/c/matrixOperations/powm/cpowma.c" - "src/c/linearAlgebra/spec/cspeca.c" - "src/c/linearAlgebra/spec/dspeca.c" - "src/c/linearAlgebra/spec/sspeca.c" - "src/c/linearAlgebra/spec/zspeca.c" "src/c/matrixOperations/transpose/ztransposea.c" "src/c/matrixOperations/transpose/stransposea.c" "src/c/matrixOperations/transpose/ctransposea.c" "src/c/matrixOperations/transpose/dtransposea.c" - "src/c/linearAlgebra/spec2/zspec2a.c" - "src/c/linearAlgebra/spec2/sspec2a.c" - "src/c/linearAlgebra/spec2/dspec2a.c" - "src/c/linearAlgebra/spec2/cspec2a.c" "src/c/matrixOperations/trace/stracea.c" "src/c/matrixOperations/trace/dtracea.c" "src/c/matrixOperations/trace/ctracea.c" @@ -312,6 +304,16 @@ function allSources = getAllSources(SharedInfo) "src/c/matrixOperations/cumprod/i16cumproda.c" "src/c/matrixOperations/cumprod/i16rowcumproda.c" "src/c/matrixOperations/cumprod/i16columncumproda.c" + "src/c/matrixOperations/matrix/dmatrixa.c" + "src/c/matrixOperations/matrix/smatrixa.c" + "src/c/matrixOperations/matrix/u16matrixa.c" + "src/c/matrixOperations/matrix/zmatrixa.c" + "src/c/matrixOperations/nnz/dnnza.c" + "src/c/matrixOperations/nnz/dnnzs.c" + "src/c/matrixOperations/nnz/snnza.c" + "src/c/matrixOperations/nnz/snnzs.c" + "src/c/matrixOperations/nnz/znnza.c" + "src/c/matrixOperations/nnz/znnzs.c" "src/c/matrixOperations/triu/dtriua.c" "src/c/matrixOperations/triu/striua.c" "src/c/matrixOperations/triu/u8triua.c" @@ -334,6 +336,23 @@ function allSources = getAllSources(SharedInfo) "src/c/matrixOperations/kron/skrona.c" "src/c/matrixOperations/norm/dnormv.c" "src/c/matrixOperations/norm/dnorma.c" + "src/c/matrixOperations/toeplitz/dtoeplitza.c" + "src/c/matrixOperations/toeplitz/u8toeplitza.c" + "src/c/matrixOperations/toeplitz/u16toeplitza.c" + "src/c/matrixOperations/toeplitz/gtoeplitza.c" + "src/c/matrixOperations/toeplitz/ztoeplitza.c" + "src/c/matrixOperations/toeplitz/stoeplitza.c" + "src/c/matrixOperations/toeplitz/ctoeplitza.c" + "src/c/matrixOperations/toeplitz/i8toeplitza.c" + "src/c/matrixOperations/toeplitz/i16toeplitza.c" + "src/c/matrixOperations/cross/dcrossa.c" + "src/c/matrixOperations/cross/zcrossa.c" + "src/c/matrixOperations/cross/ccrossa.c" + "src/c/matrixOperations/cross/scrossa.c" + "src/c/matrixOperations/cross/u8crossa.c" + "src/c/matrixOperations/cross/i8crossa.c" + "src/c/matrixOperations/cross/u16crossa.c" + "src/c/matrixOperations/cross/i16crossa.c" "src/c/elementaryFunctions/nextpow2/dnextpow2a.c" "src/c/elementaryFunctions/isreal/sisreals.c" "src/c/elementaryFunctions/isreal/disreals.c" @@ -623,10 +642,9 @@ function allSources = getAllSources(SharedInfo) "src/c/elementaryFunctions/round/i16rounds.c" "src/c/elementaryFunctions/lnp1m1/slnp1m1s.c" "src/c/elementaryFunctions/lnp1m1/dlnp1m1s.c" - - "src/c/elementaryFunctions/float/dfloats.c" + "src/c/elementaryFunctions/float/dfloats.c" "src/c/elementaryFunctions/float/dfloata.c" - "src/c/elementaryFunctions/float/sfloats.c" + "src/c/elementaryFunctions/float/sfloats.c" "src/c/elementaryFunctions/float/sfloata.c" "src/c/elementaryFunctions/float/u8floats.c" "src/c/elementaryFunctions/float/u8floata.c" @@ -636,7 +654,6 @@ function allSources = getAllSources(SharedInfo) "src/c/elementaryFunctions/float/u16floata.c" "src/c/elementaryFunctions/float/i16floats.c" "src/c/elementaryFunctions/float/i16floata.c" - "src/c/elementaryFunctions/uint8/duint8s.c" "src/c/elementaryFunctions/uint8/duint8a.c" "src/c/elementaryFunctions/uint8/suint8s.c" @@ -705,7 +722,6 @@ function allSources = getAllSources(SharedInfo) "src/c/elementaryFunctions/int32/i16int32a.c" "src/c/elementaryFunctions/int32/u32int32s.c" "src/c/elementaryFunctions/int32/u32int32a.c" - "src/c/elementaryFunctions/bitand/u8bitands.c" "src/c/elementaryFunctions/bitand/u8bitanda.c" "src/c/elementaryFunctions/bitand/u16bitands.c" @@ -764,6 +780,78 @@ function allSources = getAllSources(SharedInfo) "src/c/elementaryFunctions/acsc/cacsca.c" "src/c/elementaryFunctions/acsc/zacscs.c" "src/c/elementaryFunctions/acsc/zacsca.c" + "src/c/elementaryFunctions/isrow/disrowa.c" + "src/c/elementaryFunctions/isrow/disrows.c" + "src/c/elementaryFunctions/isrow/gisrows.c" + "src/c/elementaryFunctions/isrow/gisrowa.c" + "src/c/elementaryFunctions/isrow/sisrows.c" + "src/c/elementaryFunctions/isrow/sisrowa.c" + "src/c/elementaryFunctions/isrow/zisrowa.c" + "src/c/elementaryFunctions/isrow/zisrows.c" + "src/c/elementaryFunctions/isrow/u16isrowa.c" + "src/c/elementaryFunctions/isrow/u16isrows.c" + "src/c/elementaryFunctions/issquare/dissquarea.c" + "src/c/elementaryFunctions/issquare/dissquares.c" + "src/c/elementaryFunctions/issquare/gissquares.c" + "src/c/elementaryFunctions/issquare/gissquarea.c" + "src/c/elementaryFunctions/issquare/sissquares.c" + "src/c/elementaryFunctions/issquare/sissquarea.c" + "src/c/elementaryFunctions/issquare/zissquarea.c" + "src/c/elementaryFunctions/issquare/zissquares.c" + "src/c/elementaryFunctions/nthroot/dnthroota.c" + "src/c/elementaryFunctions/nthroot/dnthroot1a.c" + "src/c/elementaryFunctions/nthroot/dnthroots.c" + "src/c/elementaryFunctions/nthroot/snthroota.c" + "src/c/elementaryFunctions/nthroot/snthroot1a.c" + "src/c/elementaryFunctions/nthroot/snthroots.c" + "src/c/elementaryFunctions/pmodulo/dpmodulos.c" + "src/c/elementaryFunctions/pmodulo/dpmoduloa.c" + "src/c/elementaryFunctions/pmodulo/spmodulos.c" + "src/c/elementaryFunctions/pmodulo/spmoduloa.c" + "src/c/elementaryFunctions/pmodulo/i16pmodulos.c" + "src/c/elementaryFunctions/pmodulo/i16pmoduloa.c" + "src/c/elementaryFunctions/nanmax/dnanmaxa.c" + "src/c/elementaryFunctions/nanmax/dnanmaxcola.c" + "src/c/elementaryFunctions/nanmax/dnanmaxrowa.c" + "src/c/elementaryFunctions/nanmax/snanmaxa.c" + "src/c/elementaryFunctions/nanmax/snanmaxcola.c" + "src/c/elementaryFunctions/nanmax/snanmaxrowa.c" + "src/c/elementaryFunctions/isscalar/disscalara.c" + "src/c/elementaryFunctions/isscalar/disscalars.c" + "src/c/elementaryFunctions/isscalar/gisscalars.c" + "src/c/elementaryFunctions/isscalar/gisscalara.c" + "src/c/elementaryFunctions/isscalar/sisscalars.c" + "src/c/elementaryFunctions/isscalar/sisscalara.c" + "src/c/elementaryFunctions/isscalar/zisscalara.c" + "src/c/elementaryFunctions/isscalar/zisscalars.c" + "src/c/elementaryFunctions/iscolumn/discolumna.c" + "src/c/elementaryFunctions/iscolumn/discolumns.c" + "src/c/elementaryFunctions/iscolumn/giscolumns.c" + "src/c/elementaryFunctions/iscolumn/giscolumna.c" + "src/c/elementaryFunctions/iscolumn/siscolumns.c" + "src/c/elementaryFunctions/iscolumn/siscolumna.c" + "src/c/elementaryFunctions/iscolumn/ziscolumna.c" + "src/c/elementaryFunctions/iscolumn/ziscolumns.c" + "src/c/elementaryFunctions/iscolumn/u16iscolumna.c" + "src/c/elementaryFunctions/iscolumn/u16iscolumns.c" + "src/c/elementaryFunctions/isvector/disvectora.c" + "src/c/elementaryFunctions/isvector/disvectors.c" + "src/c/elementaryFunctions/isvector/gisvectors.c" + "src/c/elementaryFunctions/isvector/gisvectora.c" + "src/c/elementaryFunctions/isvector/sisvectors.c" + "src/c/elementaryFunctions/isvector/sisvectora.c" + "src/c/elementaryFunctions/isvector/zisvectora.c" + "src/c/elementaryFunctions/isvector/zisvectors.c" + "src/c/elementaryFunctions/ismatrix/dismatrixa.c" + "src/c/elementaryFunctions/ismatrix/dismatrixs.c" + "src/c/elementaryFunctions/ismatrix/gismatrixs.c" + "src/c/elementaryFunctions/ismatrix/gismatrixa.c" + "src/c/elementaryFunctions/ismatrix/sismatrixs.c" + "src/c/elementaryFunctions/ismatrix/sismatrixa.c" + "src/c/elementaryFunctions/ismatrix/zismatrixa.c" + "src/c/elementaryFunctions/ismatrix/zismatrixs.c" + "src/c/elementaryFunctions/ismatrix/u16ismatrixa.c" + "src/c/elementaryFunctions/ismatrix/u16ismatrixs.c" "src/c/elementaryFunctions/acscd/dacscda.c" "src/c/elementaryFunctions/acscd/dacscds.c" "src/c/elementaryFunctions/acscd/sacscda.c" @@ -794,6 +882,14 @@ function allSources = getAllSources(SharedInfo) "src/c/elementaryFunctions/atand/satands.c" "src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c" "src/c/elementaryFunctions/discrete_mathematics/lcm/u8lcma.c" + "src/c/elementaryFunctions/isequal/disequals.c" + "src/c/elementaryFunctions/isequal/disequala.c" + "src/c/elementaryFunctions/isequal/sisequals.c" + "src/c/elementaryFunctions/isequal/sisequala.c" + "src/c/elementaryFunctions/isequal/zisequals.c" + "src/c/elementaryFunctions/isequal/zisequala.c" + "src/c/elementaryFunctions/isequal/u16isequals.c" + "src/c/elementaryFunctions/isequal/u16isequala.c" "src/c/statisticsFunctions/max/dmaxa.c" "src/c/statisticsFunctions/max/smaxa.c" "src/c/statisticsFunctions/max/srowmaxa.c" @@ -846,6 +942,27 @@ function allSources = getAllSources(SharedInfo) "src/c/statisticsFunctions/meanf/zmeanfdz.c" "src/c/statisticsFunctions/meanf/cmeanfsc.c" "src/c/statisticsFunctions/meanf/zcolumnmeanfa.c" + "src/c/statisticsFunctions/median/dmediana.c" + "src/c/statisticsFunctions/median/dmedianrowa.c" + "src/c/statisticsFunctions/median/dmediancola.c" + "src/c/statisticsFunctions/median/smediana.c" + "src/c/statisticsFunctions/median/smedianrowa.c" + "src/c/statisticsFunctions/median/smediancola.c" + "src/c/statisticsFunctions/median/u16mediana.c" + "src/c/statisticsFunctions/median/u16medianrowa.c" + "src/c/statisticsFunctions/median/u16mediancola.c" + "src/c/statisticsFunctions/median/zmediana.c" + "src/c/statisticsFunctions/median/zmediancola.c" + "src/c/statisticsFunctions/median/zmedianrowa.c" + "src/c/statisticsFunctions/mad/dmada.c" + "src/c/statisticsFunctions/mad/dmadrowa.c" + "src/c/statisticsFunctions/mad/dmadcola.c" + "src/c/statisticsFunctions/mad/smada.c" + "src/c/statisticsFunctions/mad/smadrowa.c" + "src/c/statisticsFunctions/mad/smadcola.c" + "src/c/statisticsFunctions/mad/zmada.c" + "src/c/statisticsFunctions/mad/zmadrowa.c" + "src/c/statisticsFunctions/mad/zmadcola.c" "src/c/statisticsFunctions/prod/srowproda.c" "src/c/statisticsFunctions/prod/drowproda.c" "src/c/statisticsFunctions/prod/dproda.c" @@ -1259,20 +1376,48 @@ function allSources = getAllSources(SharedInfo) "src/c/elementaryFunctions/discrete_mathematics/primes/sprimess.c" "src/c/elementaryFunctions/discrete_mathematics/factor/dfactors.c" "src/c/elementaryFunctions/discrete_mathematics/factor/sfactors.c" + "src/c/specialFunctions/erf/derfs.c" + "src/c/specialFunctions/erf/derfa.c" + "src/c/specialFunctions/erf/serfs.c" + "src/c/specialFunctions/erf/serfa.c" + "src/c/specialFunctions/erfc/derfcs.c" + "src/c/specialFunctions/erfc/derfca.c" + "src/c/specialFunctions/erfc/serfcs.c" + "src/c/specialFunctions/erfc/serfca.c" + "src/c/specialFunctions/erfcx/derfcxs.c" + "src/c/specialFunctions/erfcx/derfcxa.c" + "src/c/specialFunctions/erfcx/serfcxs.c" + "src/c/specialFunctions/erfcx/serfcxa.c" + "src/c/specialFunctions/erfinv/derfinvs.c" + "src/c/specialFunctions/erfinv/derfinva.c" + "src/c/specialFunctions/erfinv/serfinvs.c" + "src/c/specialFunctions/erfinv/serfinva.c" "src/c/CACSD/syslin/dsyslina.c" "src/c/CACSD/lqr/dlqra.c" "src/c/CACSD/lqe/dlqea.c" "src/c/CACSD/obscont/dobsconta.c" - "src/c/linearAlgebra/sva/dsvaa.c" - "src/c/linearAlgebra/svd/dsvda.c" + "src/c/linearAlgebra/spec2/zspec2a.c" + "src/c/linearAlgebra/spec2/sspec2a.c" + "src/c/linearAlgebra/spec2/dspec2a.c" + "src/c/linearAlgebra/spec2/cspec2a.c" + "src/c/linearAlgebra/spec/cspeca.c" + "src/c/linearAlgebra/spec/dspeca.c" + "src/c/linearAlgebra/spec/sspeca.c" + "src/c/linearAlgebra/spec/zspeca.c" "src/c/linearAlgebra/schur/dschura.c" "src/c/linearAlgebra/schur/dgschura.c" "src/c/linearAlgebra/balanc/dbalanca.c" "src/c/linearAlgebra/svd/dsvda.c" "src/c/linearAlgebra/svd/zsvda.c" + "src/c/linearAlgebra/sqroot/dsqroota.c" "src/c/linearAlgebra/hess/dhessa.c" + "src/c/linearAlgebra/givens/dgivensa.c" + "src/c/linearAlgebra/householder/dhouseholdera.c" "src/c/linearAlgebra/sva/dsvaa.c" "src/c/linearAlgebra/spec/dspec1a.c" + "src/c/linearAlgebra/fullrf/dfullrfa.c" + "src/c/linearAlgebra/rowcomp/drowcompa.c" + "src/c/linearAlgebra/qr/dqra.c" "src/c/linearAlgebra/rcond/drconda.c"]; //Files to be inserted only if output format selected is 'Arduino'. @@ -1435,10 +1580,18 @@ function allSources = getAllSources(SharedInfo) "src/c/imageProcessing/cvimgproc/imcvCanny.cpp" "src/c/imageProcessing/cvimgproc/imcvCornerHarris.cpp"]; + if Target == "Arduino" & BuildTool == "nmake" + Required_addrs = get_rquird_fnctns(Standalone_files,Arduino_files,SharedInfo); + end + if Target == "StandAlone" allSources = Standalone_files; elseif Target == "Arduino" - allSources = cat(1,Standalone_files, Arduino_files); + if BuildTool == "nmake" + allSources = Required_addrs; + else + allSources = cat(1,Standalone_files, Arduino_files); + end elseif Target == "AVR" allSources = cat(1,Standalone_files, AVR_files); elseif Target == "RPi" diff --git a/macros/findDeps/get_rquird_fnctns.sci b/macros/findDeps/get_rquird_fnctns.sci new file mode 100644 index 0000000..8f3dbf8 --- /dev/null +++ b/macros/findDeps/get_rquird_fnctns.sci @@ -0,0 +1,143 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE + +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Yash Pratap Singh Tomar +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//This function creates and compares the list of functions used in scilab code to existing function list from getallSources +function Required_addrs = get_rquird_fnctns(Standalone_files,Arduino_files,SharedInfo) + Required_stdalon_indx = 1; + Required_ardno_indx = 1; + x = 1; + y = 1; + +//Creating lists for stanalone C file and function +//Some C files don't have their function name directory. So their address is being shifted to last of the list + Standalone_files_1 = Standalone_files; +// Standalone_files_extras(1) = Standalone_files_1(76); +// Standalone_files_extras(2) = Standalone_files_1(77); +// Standalone_files_extras(3) = Standalone_files_1(1009); +// Standalone_files_extras(4) = Standalone_files_1(1010); +// Standalone_files_extras(5) = Standalone_files_1(1011); +// Standalone_files_extras(6) = Standalone_files_1(1012); +// Standalone_files_1(1012) = []; +// Standalone_files_1(1011) = []; +// Standalone_files_1(1010) = []; +// Standalone_files_1(1009) = []; +// Standalone_files_1(77) = []; +// Standalone_files_1(76) = []; + +//calculating the total no. of standalone files + No_of_stdalon_files = size(Standalone_files_1); + No_of_stdalon_files = No_of_stdalon_files(1); + +//This for loop is to extract function name list from address list + for index=1:No_of_stdalon_files + K = strsplit(Standalone_files_1(index),"/"); + soK = size(K); + soK = soK(1); + Standalone_files_folders(index) = K((soK-1)); + Standalone_C_files(index) = K(soK); + Standalone_C_files(index) = strtok(Standalone_C_files(index),"."); + end + +//Here, it adds the functions to the list which were earlier removed to shift to the end + //for index=1:6 + // K = strsplit(Standalone_files_extras(index),"/"); + // Standalone_files_folders(No_of_stdalon_files+index) = K(3); + // Standalone_C_files(No_of_stdalon_files+index) = K(4); + // Standalone_files_1(No_of_stdalon_files+index)= Standalone_files_extras(index); +// Standalone_C_files(No_of_stdalon_files+index) = strtok(Standalone_C_files(No_of_stdalon_files+index),"."); +// end + +//Following similar procedure for Arduino + Arduino_files_1 = Arduino_files; + No_of_ardno_files = size(Arduino_files_1); + No_of_ardno_files = No_of_ardno_files(1); + for index=1:No_of_ardno_files + K = strsplit(Arduino_files_1(index),"/"); + soK = size(K); + soK = soK(1); + Arduino_files_folders(index) = K((soK-1)); + Arduino_C_files(index) = K(soK); + Arduino_C_files(index) = strtok(Arduino_C_files(index),"."); + end + +//comparing +//this compares the list of functions used in scilab file to the created standalone C files and function list + for index = 1:SharedInfo.Function_list_index + for k = 1:No_of_stdalon_files + if SharedInfo.Function_list(index) == Standalone_files_folders(k) + Required_fnctn_stdalon(Required_stdalon_indx) = k; + Required_fnctn_stdlon_f(x) = Standalone_C_files(k); + x = x+1; + Required_stdalon_indx = Required_stdalon_indx + 1; + end + end + end + if x == 1 + Required_fnctn_stdlon_f = []; + end +//this compares the list of functions used in scilab file to the created Arduino files and function list +Required_stdalon_indx = Required_stdalon_indx - 1; + + for index = 1:SharedInfo.Function_list_index + for k = 1:No_of_ardno_files + if SharedInfo.Function_list(index) == Arduino_files_folders(k); + Required_fnctn_ardno(Required_ardno_indx) = k; + Required_fnctn_ardno_f(y) = Arduino_C_files(k); + y = y+1; + Required_ardno_indx = Required_ardno_indx + 1; + end + end + end + + Required_ardno_indx = Required_ardno_indx - 1; +//Calling Scilab2CDeps structure + scilab2ccode = Scilab2CDeps(); +//Looking for the depencies of the C files used on other files + for index = 1:Required_stdalon_indx + call = "scilab2ccode.deps." + Standalone_C_files(Required_fnctn_stdalon(index)); + call_val = eval(call); + Required_fnctn_stdlon_f = cat(1,Required_fnctn_stdlon_f,(call_val)'); + end + + Required_fnctn_stdlon_f = unique(Required_fnctn_stdlon_f); + +//Looking for the depencies of the Arduino files used on other C or Arduino files + for index = 1:Required_ardno_indx + call = "scilab2ccode.deps." + Arduino_C_files(Required_fnctn_ardno(index)); + call_val = eval(call); + Required_fnctn_ardno_f = cat(1,Required_fnctn_ardno_f,(call_val)'); + end + Required_fnctn_ardno_f = unique(Required_fnctn_ardno_f); + +//Adding Standalone and Arudino files lists + all_files_addrs = cat(1,Standalone_files_1,Arduino_files_1); + +//Adding Requied Standalone and Arudino files lists which are to be copied + required_files = cat(1,Required_fnctn_stdlon_f,Required_fnctn_ardno_f); + required_files = unique(required_files); + no_of_required_files = size(required_files); + no_of_required_files = no_of_required_files(1); + no_of_all_files = size(all_files_addrs); + no_of_all_files = no_of_all_files(1); + + all_files = cat(1,Standalone_C_files,Arduino_C_files); + index = 1; +//Creating final list which has address of files to be copied + for i=1:no_of_required_files + for k=1:no_of_all_files + if required_files(i) == all_files(k) + Required_addrs(index) = all_files_addrs(k); + index = index + 1; + end + end + end + +endfunction diff --git a/macros/findDeps/names b/macros/findDeps/names index 2b8c551..b1825b6 100644 --- a/macros/findDeps/names +++ b/macros/findDeps/names @@ -5,3 +5,4 @@ getAllInterfaces getAllLibraries getAllSources getArduinoFiles +get_rquird_fnctns diff --git a/macros/runsci2c.sci b/macros/runsci2c.sci index 2fc66be..7475f87 100644 --- a/macros/runsci2c.sci +++ b/macros/runsci2c.sci @@ -53,10 +53,10 @@ disp(RunSci2CMainDir); [FileInfoDatFile,SharedInfoDatFile] = INIT_SCI2C(UserScilabMainFile, ...
UserSciFilesPaths, SCI2COutputPath, RunMode, Target,Board_name);
-
// -- Load FileInfo and SharedInfo
load(SharedInfoDatFile,'SharedInfo');
load(FileInfoDatFile,'FileInfo');
+
RunMode = SharedInfo.RunMode;
// --- Generation of the library structure. ---
@@ -91,7 +91,7 @@ load(SharedInfoDatFile,'SharedInfo'); // ---------------------------
global SCI2CHOME
-allSources = SCI2CHOME + "/" + getAllSources(SharedInfo);
+allSources = SCI2CHOME + "/" + getAllSources(SharedInfo, BuildTool);
allHeaders = SCI2CHOME + "/" +getAllHeaders(SharedInfo);
allInterfaces = SCI2CHOME + "/" + getAllInterfaces(SharedInfo);
if(~isempty(getAllLibraries(SharedInfo)))
@@ -100,7 +100,10 @@ else allLibraries = ''
end
//allLibraries = SCI2CHOME + "/" + getAllLibraries(Target);
-
+if (Target == 'Arduino')
+ mkdir(SCI2COutputPath+"/arduino/");
+ mkdir(SCI2COutputPath+"/arduino/sci2c_arduino");
+end
mkdir(SCI2COutputPath+"/src/");
mkdir(SCI2COutputPath+"/src/c/");
mkdir(SCI2COutputPath+"/includes/");
@@ -117,11 +120,19 @@ for i = 1:size(allSources, "*") if(~isempty(strstr(allSources(i),'dode')))
if(size(SharedInfo.Includelist) <> 0)
if((mtlb_strcmp(part(SharedInfo.Includelist(1),1:5),'odefn') == %T))
- copyfile(allSources(i), SCI2COutputPath+"/src/c/");
+ if BuildTool == "nmake"
+ copyfile(allSources(i), SCI2COutputPath+"/arduino/sci2c_arduino/");
+ else
+ copyfile(allSources(i), SCI2COutputPath+"/src/c/");
+ end
end
end
else
- copyfile(allSources(i), SCI2COutputPath+"/src/c/");
+ if BuildTool == "nmake"
+ copyfile(allSources(i), SCI2COutputPath+"/arduino/sci2c_arduino/");
+ else
+ copyfile(allSources(i), SCI2COutputPath+"/src/c/");
+ end
end
end
@@ -130,7 +141,11 @@ PrintStepInfo('Copying headers', FileInfo.GeneralReport,'both'); for i = 1:size(allHeaders, "*")
// DEBUG only
//disp("Copying "+allHeaders(i)+" in "+SCI2COutputPath+"/includes/");
- copyfile(allHeaders(i), SCI2COutputPath+"/includes/");
+ if BuildTool == "nmake"
+ copyfile(allHeaders(i), SCI2COutputPath+"/arduino/sci2c_arduino/");
+ else
+ copyfile(allHeaders(i), SCI2COutputPath+"/includes/");
+ end
end
// -- Interfaces
@@ -138,7 +153,11 @@ PrintStepInfo('Copying interfaces', FileInfo.GeneralReport,'both'); for i = 1:size(allInterfaces, "*")
// DEBUG only
//disp("Copying "+allInterfaces(i)+" in "+SCI2COutputPath+"/interfaces/");
- copyfile(allInterfaces(i), SCI2COutputPath+"/interfaces/");
+ if BuildTool == "nmake"
+ copyfile(allInterfaces(i), SCI2COutputPath+"/arduino/sci2c_arduino/");
+ else
+ copyfile(allInterfaces(i), SCI2COutputPath+"/interfaces/");
+ end
end
// -- Libraries
@@ -165,8 +184,6 @@ end if (Target == 'Arduino')
GenerateSetupFunction(FileInfo);
- mkdir(SCI2COutputPath+"/arduino/");
- mkdir(SCI2COutputPath+"/arduino/sci2c_arduino");
//Copy arduino makefile
arduinoFiles = SCI2CHOME + "/" + getArduinoFiles();
PrintStepInfo('Copying arduino files', FileInfo.GeneralReport,'both');
@@ -192,6 +209,12 @@ else C_GenerateMakefile_msvc(FileInfo,SharedInfo);
end
end
+if BuildTool == "nmake" & Target == 'Arduino'
+ movefile(SCI2COutputPath +"/setup_arduino.h", SCI2COutputPath+"/arduino/sci2c_arduino/");
+ movefile(SCI2COutputPath +"/setup_arduino.cpp", SCI2COutputPath+"/arduino/sci2c_arduino/");
+ movefile(SCI2COutputPath +"/loop_arduino.cpp", SCI2COutputPath+"/arduino/sci2c_arduino/");
+ movefile(SCI2COutputPath +"/loop_arduino.h", SCI2COutputPath+"/arduino/sci2c_arduino/");
+end
diff --git a/macros/sci2c_gui.sci b/macros/sci2c_gui.sci index bee6fe4..cad8b24 100644 --- a/macros/sci2c_gui.sci +++ b/macros/sci2c_gui.sci @@ -216,7 +216,7 @@ outformatlabel = uicontrol("parent", sci2cfig,... outformatradiostalone = uicontrol("parent", sci2cfig,... "style", "radiobutton",... "string", gettext("Stand-alone"),... - "position",[2*margin+widgetLabelWidth outformaty 2*radiow widgeth],... + "position",[2*margin+widgetLabelWidth outformaty 2*radiow-10 widgeth],... "horizontalalignment", "left",... "fontname", defaultfont,... "fontunits", "points",... @@ -309,7 +309,7 @@ runradiotranslate = uicontrol("parent", sci2cfig,... runradiogenlib = uicontrol("parent", sci2cfig,... "style", "radiobutton",... "string", gettext("Generate library"),... - "position",[2*margin+widgetLabelWidth+2*radiow runy 120 widgeth],... + "position",[2*margin+widgetLabelWidth+2*radiow+20 runy 150 widgeth],... "horizontalalignment", "left",... "fontname", defaultfont,... "fontunits", "points",... diff --git a/src/c/auxiliaryFunctions/abs/zabss.c b/src/c/auxiliaryFunctions/abs/zabss.c index 4e7b4dd..7ada57d 100644 --- a/src/c/auxiliaryFunctions/abs/zabss.c +++ b/src/c/auxiliaryFunctions/abs/zabss.c @@ -16,6 +16,7 @@ #include "sqrt.h" #include "max.h" #include "min.h" +#include "doubleComplex.h" double zabss(doubleComplex in) { double real = dabss(zreals(in)); diff --git a/src/c/elementaryFunctions/includes/iscolumn.h b/src/c/elementaryFunctions/includes/iscolumn.h new file mode 100644 index 0000000..e971176 --- /dev/null +++ b/src/c/elementaryFunctions/includes/iscolumn.h @@ -0,0 +1,42 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __ISCOLUMN_H__ +#define __ISCOLUMN_H__ + + +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" +#include "uint16.h" + +#ifdef __cplusplus +extern "C" { +#endif + +char discolumna(double* , int); +char discolumns(double); +char siscolumna( float* , int); +char siscolumns( float); +char giscolumna(char* , int); +char giscolumns(char); +char ziscolumna(doubleComplex*, int); +char ziscolumns(doubleComplex); +char u16iscolumna(uint16*, int); +char u16iscolumns(uint16); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/c/elementaryFunctions/includes/isequal.h b/src/c/elementaryFunctions/includes/isequal.h new file mode 100644 index 0000000..d22a804 --- /dev/null +++ b/src/c/elementaryFunctions/includes/isequal.h @@ -0,0 +1,38 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __ISEQUAL_H__ +#define __ISEQUAL_H__ +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" +#include "uint16.h" + +#ifdef __cplusplus +extern "C" { +#endif + +char disequals(double inp1, double inp2); +char disequala(double* inp1, int size1r, int size1c, double* inp2, int size2r, int size2c); +char sisequals(float inp1, float inp2); +char sisequala(float* inp1, int size1r, int size1c, float* inp2, int size2r, int size2c); +char zisequals(doubleComplex inp1, doubleComplex inp2); +char zisequala(doubleComplex* inp1, int size1r, int size1c, doubleComplex* inp2, int size2r, int size2c); +char u16isequals(uint16 inp1, uint16 inp2); +char u16isequala(uint16* inp1, int size1r, int size1c, uint16* inp2, int size2r, int size2c); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__ISEQUAL_H__*/ diff --git a/src/c/elementaryFunctions/includes/ismatrix.h b/src/c/elementaryFunctions/includes/ismatrix.h new file mode 100644 index 0000000..0dd8b4a --- /dev/null +++ b/src/c/elementaryFunctions/includes/ismatrix.h @@ -0,0 +1,41 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __ISMATRIX_H__ +#define __ISMATRIX_H__ + + +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" +#include "uint16.h" + +#ifdef __cplusplus +extern "C" { +#endif + +char dismatrixa(double*); +char dismatrixs(double); +char sismatrixa(float*); +char sismatrixs(float); +char gismatrixa(char*); +char gismatrixs(char); +char zismatrixa(doubleComplex*); +char zismatrixs(doubleComplex); +char u16ismatrixa(uint16*); +char u16ismatrixs(uint16); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/c/elementaryFunctions/includes/isrow.h b/src/c/elementaryFunctions/includes/isrow.h new file mode 100644 index 0000000..2de7da3 --- /dev/null +++ b/src/c/elementaryFunctions/includes/isrow.h @@ -0,0 +1,41 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __ISROW_H__ +#define __ISROW_H__ + + +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" +#include "uint16.h" + +#ifdef __cplusplus +extern "C" { +#endif + +char disrowa(double* , int); +char disrows(double); +char sisrowa( float* , int); +char sisrows( float); +char gisrowa(char* , int); +char gisrows(char); +char zisrowa(doubleComplex*, int); +char zisrows(doubleComplex); +char u16isrowa(uint16*, int); +char u16isrows(uint16); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/c/elementaryFunctions/includes/isscalar.h b/src/c/elementaryFunctions/includes/isscalar.h new file mode 100644 index 0000000..f488043 --- /dev/null +++ b/src/c/elementaryFunctions/includes/isscalar.h @@ -0,0 +1,38 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __ISSCALAR_H__ +#define __ISSCALAR_H__ + + +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +char disscalara(double* , int); +char disscalars(double); +char sisscalara( float* , int); +char sisscalars( float); +char gisscalara(char* , int); +char gisscalars(char); +char zisscalara(doubleComplex*, int); +char zisscalars(doubleComplex); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/c/elementaryFunctions/includes/issquare.h b/src/c/elementaryFunctions/includes/issquare.h new file mode 100644 index 0000000..70e4c45 --- /dev/null +++ b/src/c/elementaryFunctions/includes/issquare.h @@ -0,0 +1,38 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __ISSQUARE_H__ +#define __ISSQUARE_H__ + + +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +char dissquarea(double* , int, int); +char dissquares(double); +char sissquarea( float* , int, int); +char sissquares( float); +char gissquarea(char* , int, int); +char gissquares(char); +char zissquarea(doubleComplex*, int, int); +char zissquares(doubleComplex); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/c/elementaryFunctions/includes/isvector.h b/src/c/elementaryFunctions/includes/isvector.h new file mode 100644 index 0000000..75599cd --- /dev/null +++ b/src/c/elementaryFunctions/includes/isvector.h @@ -0,0 +1,38 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __ISVECTOR_H__ +#define __ISVECTOR_H__ + + +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +char disvectora(double* , int, int); +char disvectors(double); +char sisvectora( float* , int, int); +char sisvectors( float); +char gisvectora(char* , int, int ); +char gisvectors(char); +char zisvectora(doubleComplex*, int, int); +char zisvectors(doubleComplex); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/c/elementaryFunctions/includes/nanmax.h b/src/c/elementaryFunctions/includes/nanmax.h new file mode 100644 index 0000000..bea83f7 --- /dev/null +++ b/src/c/elementaryFunctions/includes/nanmax.h @@ -0,0 +1,40 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __NANMAX_H__ +#define __NANMAX_H__ + + +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" +#include "int16.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dnanmaxa (double* , int); +void dnanmaxrowa (double*, int , int, double*); +void dnanmaxcola (double*, int , int, double*); + +float snanmaxa (float* , int); +void snanmaxrowa (float*, int , int, float*); +void snanmaxcola (float*, int , int, float*); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/c/elementaryFunctions/includes/nthroot.h b/src/c/elementaryFunctions/includes/nthroot.h new file mode 100644 index 0000000..62b533a --- /dev/null +++ b/src/c/elementaryFunctions/includes/nthroot.h @@ -0,0 +1,37 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __NTHROOT_H__ +#define __NTHROOT_H__ + + +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" +#include "uint16.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dnthroota(double* , int ,int , double*, int , int, double*); +void dnthroot1a(double*, int , int, double, double*); +double dnthroots(double, double); +void snthroota(float* , int ,int , float*, int , int, double*); +void snthroot1a(float*, int , int, float, double*); +double snthroots(float, float); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/c/elementaryFunctions/includes/pmodulo.h b/src/c/elementaryFunctions/includes/pmodulo.h new file mode 100644 index 0000000..d46febc --- /dev/null +++ b/src/c/elementaryFunctions/includes/pmodulo.h @@ -0,0 +1,40 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __PMODULO_H__ +#define __PMODULO_H__ + + +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" +#include "int16.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dpmoduloa(double*, int ,double*, double*); +double dpmodulos(double, double); + +void spmoduloa(float*, int ,float*, float*); +float spmodulos(float, float); + +void i16pmoduloa(int16*, int ,int16*, int16*); +int16 i16pmodulos(int16, int16); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/c/elementaryFunctions/includes/pow.h b/src/c/elementaryFunctions/includes/pow.h index de1eb40..2905b7e 100644 --- a/src/c/elementaryFunctions/includes/pow.h +++ b/src/c/elementaryFunctions/includes/pow.h @@ -15,6 +15,11 @@ #include "dynlib_elementaryfunctions.h" #include "multiplication.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "uint8.h" +#include "uint16.h" +#include "int16.h" #ifdef __cplusplus extern "C" { diff --git a/src/c/elementaryFunctions/interfaces/int_iscolumn.h b/src/c/elementaryFunctions/interfaces/int_iscolumn.h new file mode 100644 index 0000000..e1011d7 --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_iscolumn.h @@ -0,0 +1,29 @@ + /*This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + + +#ifndef __INT_ISCOLUMN_H__ +#define __INT_ISCOLUMN_H__ + +#define d2iscolumng0(in,size ) discolumna(in, size[1]) +#define d0iscolumng0(in) discolumns(in) +#define s2iscolumng0(in,size) siscolumna(in, size[1]) +#define s0iscolumng0(in) siscolumns(in) +#define g2iscolumng0(in,size) giscolumna(in, size[1]) +#define g0iscolumng0(in) giscolumns(in) +#define z2iscolumng0(in,size) ziscolumna(in , size[1]) +#define z0iscolumng0(in) ziscolumns(in) +#define u162iscolumng0(in,size) u16iscolumna(in , size[1]) +#define u160iscolumng0(in) u16iscolumns(in) + + + +#endif diff --git a/src/c/elementaryFunctions/interfaces/int_isequal.h b/src/c/elementaryFunctions/interfaces/int_isequal.h new file mode 100644 index 0000000..d22ab65 --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_isequal.h @@ -0,0 +1,35 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __INT_ISEQUAL_H__ +#define __INT_ISEQUAL_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define d0d0isequalg0(in1,in2) disequals(in1,in2) +#define d2d2isequalg0(in1, s1, in2, s2) disequala(in1, s1[0], s1[1], in2, s2[0], s2[1]) +#define s0s0isequalg0(in1,in2) sisequals(in1,in2) +#define s2s2isequalg0(in1, s1, in2, s2) sisequala(in1, s1[0], s1[1], in2, s2[0], s2[1]) +#define z0z0isequalg0(in1,in2) zisequals(in1,in2) +#define z2z2isequalg0(in1, s1, in2, s2) zisequala(in1, s1[0], s1[1], in2, s2[0], s2[1]) +#define u160u160isequalg0(in1,in2) u16isequals(in1,in2) +#define u162u162isequalg0(in1, s1, in2, s2) u16isequala(in1, s1[0], s1[1], in2, s2[0], s2[1]) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_ISEQUAL_H__*/ diff --git a/src/c/elementaryFunctions/interfaces/int_ismatrix.h b/src/c/elementaryFunctions/interfaces/int_ismatrix.h new file mode 100644 index 0000000..96352d1 --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_ismatrix.h @@ -0,0 +1,28 @@ + /*This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + + +#ifndef __INT_ISMATRIX_H__ +#define __INT_ISMATRIX_H__ + +#define d2ismatrixg0(in, size ) dismatrixa(in) +#define d0ismatrixg0(in) dismatrixs(in) +#define s2ismatrixg0(in , size) sismatrixa(in) +#define s0ismatrixg0(in) sismatrixs(in) +#define g2ismatrixg0(in, size) gismatrixa(in) +#define g0ismatrixg0(in) gismatrixs(in) +#define z2ismatrixg0(in, size) zismatrixa(in) +#define z0ismatrixg0(in) zismatrixs(in) +#define u162ismatrixg0(in, size) u16ismatrixa(in) +#define u160ismatrixg0(in) u16ismatrixs(in) + + +#endif diff --git a/src/c/elementaryFunctions/interfaces/int_isrow.h b/src/c/elementaryFunctions/interfaces/int_isrow.h new file mode 100644 index 0000000..9298de9 --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_isrow.h @@ -0,0 +1,29 @@ + /*This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + + +#ifndef __INT_ISROW_H__ +#define __INT_ISROW_H__ + +#define d2isrowg0(in, size ) disrowa(in, size[0]) +#define d0isrowg0(in) disrows(in) +#define s2isrowg0(in , size) sisrowa(in, size[0]) +#define s0isrowg0(in) sisrows(in) +#define g2isrowg0(in, size) gisrowa(in, size[0]) +#define g0isrowg0(in) gisrows(in) +#define z2isrowg0(in, size) zisrowa(in , size[0]) +#define z0isrowg0(in) zisrows(in) +#define u162isrowg0(in, size) u16isrowa(in , size[0]) +#define u160isrowg0(in) u16isrows(in) + + + +#endif diff --git a/src/c/elementaryFunctions/interfaces/int_isscalar.h b/src/c/elementaryFunctions/interfaces/int_isscalar.h new file mode 100644 index 0000000..0b25be1 --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_isscalar.h @@ -0,0 +1,26 @@ + /*This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + + +#ifndef __INT_ISSCALAR_H__ +#define __INT_ISSCALAR_H__ + +#define d2isscalarg0(in, size ) disscalara(in, size[0]) +#define d0isscalarg0(in) disscalars(in) +#define s2isscalarg0(in , size) sisscalara(in, size[0]) +#define s0isscalarg0(in) sisscalars(in) +#define g2isscalarg0(in, size) gisscalara(in, size[0]) +#define g0isscalarg0(in) gisscalars(in) +#define z2isscalarg0(in, size) zisscalara(in , size[0]) +#define z0isscalarg0(in) zisscalars(in) + + +#endif diff --git a/src/c/elementaryFunctions/interfaces/int_issquare.h b/src/c/elementaryFunctions/interfaces/int_issquare.h new file mode 100644 index 0000000..0535788 --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_issquare.h @@ -0,0 +1,25 @@ + /*This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + + +#ifndef __INT_ISSQUARE_H__ +#define __INT_ISSQUARE_H__ + +#define d2issquareg0(in, size ) dissquarea(in, size[0], size[1]) +#define d0issquareg0(in) dissquares(in) +#define s2issquareg0(in , size) sissquarea(in, size[0], size[1]) +#define s0issquareg0(in) sissquares(in) +#define g2issquareg0(in, size) gissquarea(in, size[0], size[1]) +#define g0issquareg0(in) gissquares(in) +#define z2issquareg0(in, size) zissquarea(in , size[0], size[1]) +#define z0issquareg0(in) zissquares(in) + +#endif diff --git a/src/c/elementaryFunctions/interfaces/int_isvector.h b/src/c/elementaryFunctions/interfaces/int_isvector.h new file mode 100644 index 0000000..a4edaea --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_isvector.h @@ -0,0 +1,26 @@ + /*This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + + +#ifndef __INT_ISVECTOR_H__ +#define __INT_ISVECTOR_H__ + +#define d2isvectorg0(in, size ) disvectora(in, size[0], size[1]) +#define d0isvectorg0(in) disvectors(in) +#define s2isvectorg0(in , size) sisvectora(in, size[0], size[1]) +#define s0isvectorg0(in) sisvectors(in) +#define g2isvectorg0(in, size) gisvectora(in, size[0], size[1]) +#define g0isvectorg0(in) gisvectors(in) +#define z2isvectorg0(in, size) zisvectora(in , size[0], size[1]) +#define z0isvectorg0(in) zisvectors(in) + + +#endif diff --git a/src/c/elementaryFunctions/interfaces/int_nanmax.h b/src/c/elementaryFunctions/interfaces/int_nanmax.h new file mode 100644 index 0000000..dd3df71 --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_nanmax.h @@ -0,0 +1,27 @@ + /*This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + + +#ifndef __INT_NANMAX_H__ +#define __INT_NANMAX_H__ + +#define d2nanmaxd0(in1, size) dnanmaxa(in1,size[0]* size[1]) +#define d2g2nanmaxd2(in1, size1, in2, size2, out) (in2[0]=='r') ? dnanmaxrowa(in1, size1[0], size1[1], out) : dnanmaxcola(in1, size1[0] , size1[1], out) + +#define s2nanmaxs0(in1, size) snanmaxa(in1,size[0]* size[1]) +#define s2g2nanmaxs2(in1, size1, in2, size2, out) (in2[0]=='r') ? snanmaxrowa(in1, size1[0], size1[1], out) : snanmaxcola(in1, size1[0] , size1[1], out) + + +//#define i160i160pmoduloi160(in1, in2) i16pmodulos(in1,in2) +//#define i162i162pmoduloi162(in1, size1, in2, size2, out) i16pmoduloa(in1,size1[0]*size1[1],in2, out) + + +#endif diff --git a/src/c/elementaryFunctions/interfaces/int_nthroot.h b/src/c/elementaryFunctions/interfaces/int_nthroot.h new file mode 100644 index 0000000..aa48fcc --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_nthroot.h @@ -0,0 +1,23 @@ + /*This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + + +#ifndef __INT_NTHROOT_H__ +#define __INT_NTHROOT_H__ + +#define d2d2nthrootd2(in1, size1, in2, size2, out) dnthroota(in1, size1[0], size1[1], in2, size2[0], size2[1], out) +#define d2d0nthrootd2(in1, size1, in2, out) dnthroot1a(in1, size1[0], size1[1], in2, out) +#define d0d0nthrootd0(in1, in2) dnthroots(in1, in2) +#define s2s2nthrootd2(in1, size1, in2, size2, out) snthroota(in1, size1[0], size1[1], in2, size2[0], size2[1], out) +#define s2s0nthrootd2(in1, size1, in2, out) snthroot1a(in1, size1[0], size1[1], in2, out) +#define s0s0nthrootd0(in1, in2) snthroots(in1, in2) + +#endif diff --git a/src/c/elementaryFunctions/interfaces/int_pmodulo.h b/src/c/elementaryFunctions/interfaces/int_pmodulo.h new file mode 100644 index 0000000..72b1277 --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_pmodulo.h @@ -0,0 +1,26 @@ + /*This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + + +#ifndef __INT_PMODULO_H__ +#define __INT_PMODULO_H__ + +#define d0d0pmodulod0(in1, in2) dpmodulos(in1,in2) +#define d2d2pmodulod2(in1, size1, in2, size2, out) dpmoduloa(in1,size1[0]*size1[1],in2, out) + +#define s0s0pmodulos0(in1, in2) spmodulos(in1,in2) +#define s2s2pmodulos2(in1, size1, in2, size2, out) spmoduloa(in1,size1[0]*size1[1],in2, out) + +#define i160i160pmoduloi160(in1, in2) i16pmodulos(in1,in2) +#define i162i162pmoduloi162(in1, size1, in2, size2, out) i16pmoduloa(in1,size1[0]*size1[1],in2, out) + + +#endif diff --git a/src/c/elementaryFunctions/iscolumn/discolumna.c b/src/c/elementaryFunctions/iscolumn/discolumna.c new file mode 100644 index 0000000..8bebfca --- /dev/null +++ b/src/c/elementaryFunctions/iscolumn/discolumna.c @@ -0,0 +1,26 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "iscolumn.h" +#include "types.h" +char discolumna(double* inp, int size1) +{ + char out= 'F' ; + if(size1==1) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/iscolumn/discolumns.c b/src/c/elementaryFunctions/iscolumn/discolumns.c new file mode 100644 index 0000000..b81074b --- /dev/null +++ b/src/c/elementaryFunctions/iscolumn/discolumns.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "iscolumn.h" +#include "types.h" + +char discolumns(double inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/iscolumn/giscolumna.c b/src/c/elementaryFunctions/iscolumn/giscolumna.c new file mode 100644 index 0000000..db6ff43 --- /dev/null +++ b/src/c/elementaryFunctions/iscolumn/giscolumna.c @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "iscolumn.h" +#include "types.h" +#include "string.h" +char giscolumna(char *inp, int size1) +{ + char out='F'; + if(size1==1) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/iscolumn/giscolumns.c b/src/c/elementaryFunctions/iscolumn/giscolumns.c new file mode 100644 index 0000000..57b93e9 --- /dev/null +++ b/src/c/elementaryFunctions/iscolumn/giscolumns.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "iscolumn.h" +#include "types.h" + +char giscolumns(char inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/iscolumn/siscolumna.c b/src/c/elementaryFunctions/iscolumn/siscolumna.c new file mode 100644 index 0000000..ed4ee5b --- /dev/null +++ b/src/c/elementaryFunctions/iscolumn/siscolumna.c @@ -0,0 +1,26 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "iscolumn.h" +#include "types.h" +char siscolumna(float* inp, int size1) +{ + char out='F'; + if(size1==1) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/iscolumn/siscolumns.c b/src/c/elementaryFunctions/iscolumn/siscolumns.c new file mode 100644 index 0000000..ebb89e1 --- /dev/null +++ b/src/c/elementaryFunctions/iscolumn/siscolumns.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "iscolumn.h" +#include "types.h" + +char siscolumns(float inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/iscolumn/u16iscolumna.c b/src/c/elementaryFunctions/iscolumn/u16iscolumna.c new file mode 100644 index 0000000..ef0821d --- /dev/null +++ b/src/c/elementaryFunctions/iscolumn/u16iscolumna.c @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "iscolumn.h" +#include "types.h" +#include "uint16.h" +char u16iscolumna(uint16* inp, int size1) +{ + char out='F'; + if(size1==1) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/iscolumn/u16iscolumns.c b/src/c/elementaryFunctions/iscolumn/u16iscolumns.c new file mode 100644 index 0000000..7a17464 --- /dev/null +++ b/src/c/elementaryFunctions/iscolumn/u16iscolumns.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "iscolumn.h" +#include "types.h" +#include "uint16.h" + +char u16iscolumns(uint16 inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/iscolumn/ziscolumna.c b/src/c/elementaryFunctions/iscolumn/ziscolumna.c new file mode 100644 index 0000000..a1aca1b --- /dev/null +++ b/src/c/elementaryFunctions/iscolumn/ziscolumna.c @@ -0,0 +1,28 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "doubleComplex.h" +#include "iscolumn.h" +#include "types.h" + +char ziscolumna(doubleComplex *inp, int size1) +{ + char out='F'; + if(size1==1) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/iscolumn/ziscolumns.c b/src/c/elementaryFunctions/iscolumn/ziscolumns.c new file mode 100644 index 0000000..f1d2850 --- /dev/null +++ b/src/c/elementaryFunctions/iscolumn/ziscolumns.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "iscolumn.h" +#include "types.h" +#include "doubleComplex.h" + +char ziscolumns(doubleComplex inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/isequal/disequala.c b/src/c/elementaryFunctions/isequal/disequala.c new file mode 100644 index 0000000..8781ac7 --- /dev/null +++ b/src/c/elementaryFunctions/isequal/disequala.c @@ -0,0 +1,39 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <isreal.h> + +char disequala(double* inp1, int size1r, int size1c, double* inp2, int size2r, int size2c) +{ + if ((size1r != size2r) && (size1c != size2c)) + return 'F'; + else + { + int i, f = 0; + for (i = 0; i<size1r*size1c; i++) + { + if (inp1[i] != inp2[i]) + { + f = 1; + break; + } + } + + if (f == 1) + return 'F'; + else + return 'T'; + } +} + diff --git a/src/c/elementaryFunctions/isequal/disequals.c b/src/c/elementaryFunctions/isequal/disequals.c new file mode 100644 index 0000000..319c330 --- /dev/null +++ b/src/c/elementaryFunctions/isequal/disequals.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <isreal.h> + +char disequals(double inp1, double inp2) +{ + if (inp1 == inp2) + return 'T'; + else + return 'F'; +} + diff --git a/src/c/elementaryFunctions/isequal/sisequala.c b/src/c/elementaryFunctions/isequal/sisequala.c new file mode 100644 index 0000000..2634efd --- /dev/null +++ b/src/c/elementaryFunctions/isequal/sisequala.c @@ -0,0 +1,39 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <isreal.h> + +char sisequala(float* inp1, int size1r, int size1c, float* inp2, int size2r, int size2c) +{ + if ((size1r != size2r) && (size1c != size2c)) + return 'F'; + else + { + int i, f = 0; + for (i = 0; i<size1r*size1c; i++) + { + if (inp1[i] != inp2[i]) + { + f = 1; + break; + } + } + + if (f == 1) + return 'F'; + else + return 'T'; + } +} + diff --git a/src/c/elementaryFunctions/isequal/sisequals.c b/src/c/elementaryFunctions/isequal/sisequals.c new file mode 100644 index 0000000..66bef36 --- /dev/null +++ b/src/c/elementaryFunctions/isequal/sisequals.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <isreal.h> + +char sisequals(float inp1, float inp2) +{ + if (inp1 == inp2) + return 'T'; + else + return 'F'; +} + diff --git a/src/c/elementaryFunctions/isequal/u16isequala.c b/src/c/elementaryFunctions/isequal/u16isequala.c new file mode 100644 index 0000000..62de1e8 --- /dev/null +++ b/src/c/elementaryFunctions/isequal/u16isequala.c @@ -0,0 +1,40 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <isreal.h> +#include "uint16.h" + +char u16isequala(uint16* inp1, int size1r, int size1c, uint16* inp2, int size2r, int size2c) +{ + if ((size1r != size2r) && (size1c != size2c)) + return 'F'; + else + { + int i, f = 0; + for (i = 0; i<size1r*size1c; i++) + { + if (inp1[i] != inp2[i]) + { + f = 1; + break; + } + } + + if (f == 1) + return 'F'; + else + return 'T'; + } +} + diff --git a/src/c/elementaryFunctions/isequal/u16isequals.c b/src/c/elementaryFunctions/isequal/u16isequals.c new file mode 100644 index 0000000..4f797d4 --- /dev/null +++ b/src/c/elementaryFunctions/isequal/u16isequals.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <isreal.h> +#include "uint16.h" + +char u16isequals(uint16 inp1, uint16 inp2) +{ + if (inp1 == inp2) + return 'T'; + else + return 'F'; +} + diff --git a/src/c/elementaryFunctions/isequal/zisequala.c b/src/c/elementaryFunctions/isequal/zisequala.c new file mode 100644 index 0000000..13d241f --- /dev/null +++ b/src/c/elementaryFunctions/isequal/zisequala.c @@ -0,0 +1,40 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <isreal.h> +#include "doubleComplex.h" + +char zisequala(doubleComplex* inp1, int size1r, int size1c, doubleComplex* inp2, int size2r, int size2c) +{ + if ((size1r != size2r) && (size1c != size2c)) + return 'F'; + else + { + int i, f = 0; + for (i = 0; i<size1r*size1c; i++) + { + if (!(zisequals(inp1[i],inp2[i]))) + { + f = 1; + break; + } + } + + if (f == 1) + return 'F'; + else + return 'T'; + } +} + diff --git a/src/c/elementaryFunctions/isequal/zisequals.c b/src/c/elementaryFunctions/isequal/zisequals.c new file mode 100644 index 0000000..6914dc8 --- /dev/null +++ b/src/c/elementaryFunctions/isequal/zisequals.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <isreal.h> +#include "doubleComplex.h" + +char zisequals(doubleComplex inp1, doubleComplex inp2) +{ + if ((zreals(inp1) == zreals(inp2)) && (zimags(inp1) == zimags(inp2))) + return 'T'; + else + return 'F'; +} + diff --git a/src/c/elementaryFunctions/ismatrix/dismatrixa.c b/src/c/elementaryFunctions/ismatrix/dismatrixa.c new file mode 100644 index 0000000..4fe7d19 --- /dev/null +++ b/src/c/elementaryFunctions/ismatrix/dismatrixa.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ismatrix.h" +#include "types.h" +char dismatrixa(double* in) +{ + char out= 'T' ; + return out; +} diff --git a/src/c/elementaryFunctions/ismatrix/dismatrixs.c b/src/c/elementaryFunctions/ismatrix/dismatrixs.c new file mode 100644 index 0000000..15edcf2 --- /dev/null +++ b/src/c/elementaryFunctions/ismatrix/dismatrixs.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ismatrix.h" +#include "types.h" +char dismatrixs(double in) +{ + char out= 'T' ; + return out; +} diff --git a/src/c/elementaryFunctions/ismatrix/gismatrixa.c b/src/c/elementaryFunctions/ismatrix/gismatrixa.c new file mode 100644 index 0000000..f728814 --- /dev/null +++ b/src/c/elementaryFunctions/ismatrix/gismatrixa.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ismatrix.h" +#include "types.h" +char gismatrixa(char* in) +{ + char out= 'T' ; + return out; +} diff --git a/src/c/elementaryFunctions/ismatrix/gismatrixs.c b/src/c/elementaryFunctions/ismatrix/gismatrixs.c new file mode 100644 index 0000000..61a3062 --- /dev/null +++ b/src/c/elementaryFunctions/ismatrix/gismatrixs.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ismatrix.h" +#include "types.h" +char gismatrixs(char in) +{ + char out= 'T' ; + return out; +} diff --git a/src/c/elementaryFunctions/ismatrix/sismatrixa.c b/src/c/elementaryFunctions/ismatrix/sismatrixa.c new file mode 100644 index 0000000..44335b8 --- /dev/null +++ b/src/c/elementaryFunctions/ismatrix/sismatrixa.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ismatrix.h" +#include "types.h" +char sismatrixa(float* in) +{ + char out= 'T' ; + return out; +} diff --git a/src/c/elementaryFunctions/ismatrix/sismatrixs.c b/src/c/elementaryFunctions/ismatrix/sismatrixs.c new file mode 100644 index 0000000..d6c6f23 --- /dev/null +++ b/src/c/elementaryFunctions/ismatrix/sismatrixs.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ismatrix.h" +#include "types.h" +char sismatrixs(float in) +{ + char out= 'T' ; + return out; +} diff --git a/src/c/elementaryFunctions/ismatrix/u16ismatrixa.c b/src/c/elementaryFunctions/ismatrix/u16ismatrixa.c new file mode 100644 index 0000000..c16d54c --- /dev/null +++ b/src/c/elementaryFunctions/ismatrix/u16ismatrixa.c @@ -0,0 +1,23 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ismatrix.h" +#include "types.h" +#include "uint16.h" +char u16ismatrixa(uint16* in) +{ + char out= 'T' ; + return out; +} diff --git a/src/c/elementaryFunctions/ismatrix/u16ismatrixs.c b/src/c/elementaryFunctions/ismatrix/u16ismatrixs.c new file mode 100644 index 0000000..6431357 --- /dev/null +++ b/src/c/elementaryFunctions/ismatrix/u16ismatrixs.c @@ -0,0 +1,23 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ismatrix.h" +#include "types.h" +#include "uint16.h" +char u16ismatrixs(uint16 in) +{ + char out= 'T' ; + return out; +} diff --git a/src/c/elementaryFunctions/ismatrix/zismatrixa.c b/src/c/elementaryFunctions/ismatrix/zismatrixa.c new file mode 100644 index 0000000..32d7260 --- /dev/null +++ b/src/c/elementaryFunctions/ismatrix/zismatrixa.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ismatrix.h" +#include "types.h" +#include "uint16.h" +#include "doubleComplex.h" +char zismatrixa(doubleComplex* in) +{ + char out= 'T' ; + return out; +} diff --git a/src/c/elementaryFunctions/ismatrix/zismatrixs.c b/src/c/elementaryFunctions/ismatrix/zismatrixs.c new file mode 100644 index 0000000..d38592c --- /dev/null +++ b/src/c/elementaryFunctions/ismatrix/zismatrixs.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ismatrix.h" +#include "types.h" +#include "uint16.h" +#include "doubleComplex.h" +char zismatrixs(doubleComplex in) +{ + char out= 'T' ; + return out; +} diff --git a/src/c/elementaryFunctions/isrow/disrowa.c b/src/c/elementaryFunctions/isrow/disrowa.c new file mode 100644 index 0000000..826afca --- /dev/null +++ b/src/c/elementaryFunctions/isrow/disrowa.c @@ -0,0 +1,26 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isrow.h" +#include "types.h" +char disrowa(double* inp, int size1) +{ + char out= 'F' ; + if(size1==1) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/isrow/disrows.c b/src/c/elementaryFunctions/isrow/disrows.c new file mode 100644 index 0000000..e3bdadb --- /dev/null +++ b/src/c/elementaryFunctions/isrow/disrows.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isrow.h" +#include "types.h" + +char disrows(double inp) +{ + double out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/isrow/gisrowa.c b/src/c/elementaryFunctions/isrow/gisrowa.c new file mode 100644 index 0000000..c62350f --- /dev/null +++ b/src/c/elementaryFunctions/isrow/gisrowa.c @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isrow.h" +#include "types.h" +#include "string.h" +char gisrowa(char *inp, int size1) +{ + char out='F'; + if(size1==1) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/isrow/gisrows.c b/src/c/elementaryFunctions/isrow/gisrows.c new file mode 100644 index 0000000..a4393bd --- /dev/null +++ b/src/c/elementaryFunctions/isrow/gisrows.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isrow.h" +#include "types.h" + +char gisrows(char inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/isrow/sisrowa.c b/src/c/elementaryFunctions/isrow/sisrowa.c new file mode 100644 index 0000000..bf9d4c3 --- /dev/null +++ b/src/c/elementaryFunctions/isrow/sisrowa.c @@ -0,0 +1,26 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isrow.h" +#include "types.h" +char sisrowa(float* inp, int size1) +{ + char out='F'; + if(size1==1) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/isrow/sisrows.c b/src/c/elementaryFunctions/isrow/sisrows.c new file mode 100644 index 0000000..331e0a9 --- /dev/null +++ b/src/c/elementaryFunctions/isrow/sisrows.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isrow.h" +#include "types.h" + +char sisrows(float inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/isrow/u16isrowa.c b/src/c/elementaryFunctions/isrow/u16isrowa.c new file mode 100644 index 0000000..3ddbb0f --- /dev/null +++ b/src/c/elementaryFunctions/isrow/u16isrowa.c @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isrow.h" +#include "types.h" +#include "uint16.h" +char u16isrowa(uint16* inp, int size1) +{ + char out='F'; + if(size1==1) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/isrow/u16isrows.c b/src/c/elementaryFunctions/isrow/u16isrows.c new file mode 100644 index 0000000..2942dd3 --- /dev/null +++ b/src/c/elementaryFunctions/isrow/u16isrows.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isrow.h" +#include "types.h" +#include "uint16.h" + +char u16isrows(uint16 inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/isrow/zisrowa.c b/src/c/elementaryFunctions/isrow/zisrowa.c new file mode 100644 index 0000000..312ddf5 --- /dev/null +++ b/src/c/elementaryFunctions/isrow/zisrowa.c @@ -0,0 +1,28 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "doubleComplex.h" +#include "isrow.h" +#include "types.h" + +char zisrowa(doubleComplex *inp, int size1) +{ + char out='F'; + if(size1==1) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/isrow/zisrows.c b/src/c/elementaryFunctions/isrow/zisrows.c new file mode 100644 index 0000000..96e671a --- /dev/null +++ b/src/c/elementaryFunctions/isrow/zisrows.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isrow.h" +#include "types.h" +#include "doubleComplex.h" + +char zisrows(doubleComplex inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/isscalar/disscalara.c b/src/c/elementaryFunctions/isscalar/disscalara.c new file mode 100644 index 0000000..eb70cf6 --- /dev/null +++ b/src/c/elementaryFunctions/isscalar/disscalara.c @@ -0,0 +1,23 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isscalar.h" +#include "types.h" +char disscalara(double* inp, int size1) +{ + char out= 'F' ; + + return out; +} diff --git a/src/c/elementaryFunctions/isscalar/disscalars.c b/src/c/elementaryFunctions/isscalar/disscalars.c new file mode 100644 index 0000000..fe7ce3e --- /dev/null +++ b/src/c/elementaryFunctions/isscalar/disscalars.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isscalar.h" +#include "types.h" + +char disscalars(double inp) +{ + double out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/isscalar/gisscalara.c b/src/c/elementaryFunctions/isscalar/gisscalara.c new file mode 100644 index 0000000..fdfac77 --- /dev/null +++ b/src/c/elementaryFunctions/isscalar/gisscalara.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isscalar.h" +#include "types.h" +#include "string.h" +char gisscalara(char *inp, int size1) +{ + char out='F'; + + return out; +} diff --git a/src/c/elementaryFunctions/isscalar/gisscalars.c b/src/c/elementaryFunctions/isscalar/gisscalars.c new file mode 100644 index 0000000..5a20895 --- /dev/null +++ b/src/c/elementaryFunctions/isscalar/gisscalars.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isscalar.h" +#include "types.h" + +char giscalars(char inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/isscalar/sisscalara.c b/src/c/elementaryFunctions/isscalar/sisscalara.c new file mode 100644 index 0000000..59a5165 --- /dev/null +++ b/src/c/elementaryFunctions/isscalar/sisscalara.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isscalar.h" +#include "types.h" +char sisscalara(float* inp, int size1) +{ + char out='F'; + return out; +} diff --git a/src/c/elementaryFunctions/isscalar/sisscalars.c b/src/c/elementaryFunctions/isscalar/sisscalars.c new file mode 100644 index 0000000..6ca7c4b --- /dev/null +++ b/src/c/elementaryFunctions/isscalar/sisscalars.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isscalar.h" +#include "types.h" + +char sisscalars(float inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/isscalar/zisscalara.c b/src/c/elementaryFunctions/isscalar/zisscalara.c new file mode 100644 index 0000000..942bbb5 --- /dev/null +++ b/src/c/elementaryFunctions/isscalar/zisscalara.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "doubleComplex.h" +#include "isscalar.h" +#include "types.h" + +char zisscalara(doubleComplex *inp, int size1) +{ + char out='F'; + + return out; +} diff --git a/src/c/elementaryFunctions/isscalar/zisscalars.c b/src/c/elementaryFunctions/isscalar/zisscalars.c new file mode 100644 index 0000000..2bf8e94 --- /dev/null +++ b/src/c/elementaryFunctions/isscalar/zisscalars.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isscalar.h" +#include "types.h" +#include "doubleComplex.h" + +char zisscalars(doubleComplex inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/issquare/dissquarea.c b/src/c/elementaryFunctions/issquare/dissquarea.c new file mode 100644 index 0000000..840190d --- /dev/null +++ b/src/c/elementaryFunctions/issquare/dissquarea.c @@ -0,0 +1,26 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "issquare.h" +#include "types.h" +char dissquarea(double* inp, int size1, int size2) +{ + char out= 'F' ; + if(size1==size2) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/issquare/dissquares.c b/src/c/elementaryFunctions/issquare/dissquares.c new file mode 100644 index 0000000..ac6d67e --- /dev/null +++ b/src/c/elementaryFunctions/issquare/dissquares.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "issquare.h" +#include "types.h" + +char dissquares(double inp) +{ + double out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/issquare/gissquarea.c b/src/c/elementaryFunctions/issquare/gissquarea.c new file mode 100644 index 0000000..73e2b37 --- /dev/null +++ b/src/c/elementaryFunctions/issquare/gissquarea.c @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "issquare.h" +#include "types.h" +#include "string.h" +char gissquarea(char *inp, int size1, int size2) +{ + char out='F'; + if(size1==size2) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/issquare/gissquares.c b/src/c/elementaryFunctions/issquare/gissquares.c new file mode 100644 index 0000000..572afd1 --- /dev/null +++ b/src/c/elementaryFunctions/issquare/gissquares.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "issquare.h" +#include "types.h" + +char gissquares(char inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/issquare/sissquarea.c b/src/c/elementaryFunctions/issquare/sissquarea.c new file mode 100644 index 0000000..856cb81 --- /dev/null +++ b/src/c/elementaryFunctions/issquare/sissquarea.c @@ -0,0 +1,26 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "issquare.h" +#include "types.h" +char sissquarea(float* inp, int size1, int size2) +{ + char out='F'; + if(size1==size2) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/issquare/sissquares.c b/src/c/elementaryFunctions/issquare/sissquares.c new file mode 100644 index 0000000..1a6fbf8 --- /dev/null +++ b/src/c/elementaryFunctions/issquare/sissquares.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "issquare.h" +#include "types.h" + +char sissquares(float inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/issquare/zissquarea.c b/src/c/elementaryFunctions/issquare/zissquarea.c new file mode 100644 index 0000000..023b8fc --- /dev/null +++ b/src/c/elementaryFunctions/issquare/zissquarea.c @@ -0,0 +1,28 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "doubleComplex.h" +#include "issquare.h" +#include "types.h" + +char zissquarea(doubleComplex *inp, int size1, int size2) +{ + char out='F'; + if(size1==size2) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/issquare/zissquares.c b/src/c/elementaryFunctions/issquare/zissquares.c new file mode 100644 index 0000000..2c1bb56 --- /dev/null +++ b/src/c/elementaryFunctions/issquare/zissquares.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "issquare.h" +#include "types.h" +#include "doubleComplex.h" + +char zissquares(doubleComplex inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/isvector/disvectora.c b/src/c/elementaryFunctions/isvector/disvectora.c new file mode 100644 index 0000000..a96485b --- /dev/null +++ b/src/c/elementaryFunctions/isvector/disvectora.c @@ -0,0 +1,23 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isvector.h" +#include "types.h" +char disvectora(double* inp, int row, int col) +{ + if(row ==1 || col==1) + return 'T'; + return 'F'; +} diff --git a/src/c/elementaryFunctions/isvector/disvectors.c b/src/c/elementaryFunctions/isvector/disvectors.c new file mode 100644 index 0000000..703e667 --- /dev/null +++ b/src/c/elementaryFunctions/isvector/disvectors.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isvector.h" +#include "types.h" + +char disvectors(double inp) +{ + double out='F'; + + return out; +} diff --git a/src/c/elementaryFunctions/isvector/gisvectora.c b/src/c/elementaryFunctions/isvector/gisvectora.c new file mode 100644 index 0000000..758fa87 --- /dev/null +++ b/src/c/elementaryFunctions/isvector/gisvectora.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isvector.h" +#include "types.h" +#include "string.h" +char gisvectora(char *inp, int row, int col) +{ + if(row ==1 || col==1) + return 'T'; + return 'F'; +} diff --git a/src/c/elementaryFunctions/isvector/gisvectors.c b/src/c/elementaryFunctions/isvector/gisvectors.c new file mode 100644 index 0000000..7211860 --- /dev/null +++ b/src/c/elementaryFunctions/isvector/gisvectors.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isvector.h" +#include "types.h" + +char gisvectors(char inp) +{ + char out='F'; + + return out; +} diff --git a/src/c/elementaryFunctions/isvector/sisvectora.c b/src/c/elementaryFunctions/isvector/sisvectora.c new file mode 100644 index 0000000..d6a4821 --- /dev/null +++ b/src/c/elementaryFunctions/isvector/sisvectora.c @@ -0,0 +1,23 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isvector.h" +#include "types.h" +char sisvectora(float* inp, int row, int col) +{ + if(row ==1 || col==1) + return 'T'; + return 'F'; +} diff --git a/src/c/elementaryFunctions/isvector/sisvectors.c b/src/c/elementaryFunctions/isvector/sisvectors.c new file mode 100644 index 0000000..019bd46 --- /dev/null +++ b/src/c/elementaryFunctions/isvector/sisvectors.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isvector.h" +#include "types.h" + +char sisvectors(float inp) +{ + char out='F'; + + return out; +} diff --git a/src/c/elementaryFunctions/isvector/zisvectora.c b/src/c/elementaryFunctions/isvector/zisvectora.c new file mode 100644 index 0000000..0ed64a6 --- /dev/null +++ b/src/c/elementaryFunctions/isvector/zisvectora.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "doubleComplex.h" +#include "isvector.h" +#include "types.h" + +char zisvectora(doubleComplex *inp, int row, int col) +{ + if(row ==1 || col==1) + return 'T'; + return 'F'; +} diff --git a/src/c/elementaryFunctions/isvector/zisvectors.c b/src/c/elementaryFunctions/isvector/zisvectors.c new file mode 100644 index 0000000..bc9e5ce --- /dev/null +++ b/src/c/elementaryFunctions/isvector/zisvectors.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isvector.h" +#include "types.h" +#include "doubleComplex.h" + +char zisvectors(doubleComplex inp) +{ + char out='F'; + + return out; +} diff --git a/src/c/elementaryFunctions/nanmax/dnanmaxa.c b/src/c/elementaryFunctions/nanmax/dnanmaxa.c new file mode 100644 index 0000000..4ff4a1a --- /dev/null +++ b/src/c/elementaryFunctions/nanmax/dnanmaxa.c @@ -0,0 +1,53 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nanmax.h" +#include "types.h" +double dnanmaxa(double* in, int size) +{ +double high; +for(int i=0; i<size; i++) +{ + if( !(isnan(in[i])) ) + { + high= in[i]; + break; + + } +} + + + + for(int i=0; i< size; i++) + { + if( !(isnan(in[i])) ) + { + if( in[i] > high) + { + high= in[i]; + + } + + + } + + + } + + + +return high; + +} diff --git a/src/c/elementaryFunctions/nanmax/dnanmaxcola.c b/src/c/elementaryFunctions/nanmax/dnanmaxcola.c new file mode 100644 index 0000000..9db0742 --- /dev/null +++ b/src/c/elementaryFunctions/nanmax/dnanmaxcola.c @@ -0,0 +1,35 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "nanmax.h" +#include "types.h" +#include "uint16.h" + +void dnanmaxcola(double *in, int row, int col, double* out) +{ + double inter[col]; + + +for(int i=0; i< row; i++) + { + for(int j=0 ; j< col; j++) + { + inter[j]= in[i+ (j*row)]; + + } + out[i]= dnanmaxa( inter, col); + + } + + +} diff --git a/src/c/elementaryFunctions/nanmax/dnanmaxrowa.c b/src/c/elementaryFunctions/nanmax/dnanmaxrowa.c new file mode 100644 index 0000000..191fa01 --- /dev/null +++ b/src/c/elementaryFunctions/nanmax/dnanmaxrowa.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "nanmax.h" +#include "types.h" +#include "uint16.h" + +void dnanmaxrowa(double *in, int row, int col, double* out) +{ + double inter[row]; + + + +for(int i=0; i< col; i++) + { + for(int j=0 ; j< row; j++) + { + inter[j]= in[j+ (i*row)]; + + } + out[i]= dnanmaxa( inter, row); + + } + + +} diff --git a/src/c/elementaryFunctions/nanmax/snanmaxa.c b/src/c/elementaryFunctions/nanmax/snanmaxa.c new file mode 100644 index 0000000..1eab1ac --- /dev/null +++ b/src/c/elementaryFunctions/nanmax/snanmaxa.c @@ -0,0 +1,53 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nanmax.h" +#include "types.h" +float snanmaxa(float* in, int size) +{ +float high; +for(int i=0; i<size; i++) +{ + if( !(isnan(in[i])) ) + { + high= in[i]; + break; + + } +} + + + + for(int i=0; i< size; i++) + { + if( !(isnan(in[i])) ) + { + if( in[i] > high) + { + high= in[i]; + + } + + + } + + + } + + + +return high; + +} diff --git a/src/c/elementaryFunctions/nanmax/snanmaxcola.c b/src/c/elementaryFunctions/nanmax/snanmaxcola.c new file mode 100644 index 0000000..b408052 --- /dev/null +++ b/src/c/elementaryFunctions/nanmax/snanmaxcola.c @@ -0,0 +1,35 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "nanmax.h" +#include "types.h" +#include "uint16.h" + +void snanmaxcola(float *in, int row, int col, float* out) +{ + float inter[col]; + + +for(int i=0; i< row; i++) + { + for(int j=0 ; j< col; j++) + { + inter[j]= in[i+ (j*row)]; + + } + out[i]= snanmaxa( inter, col); + + } + + +} diff --git a/src/c/elementaryFunctions/nanmax/snanmaxrowa.c b/src/c/elementaryFunctions/nanmax/snanmaxrowa.c new file mode 100644 index 0000000..ab1ce0c --- /dev/null +++ b/src/c/elementaryFunctions/nanmax/snanmaxrowa.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "nanmax.h" +#include "types.h" +#include "uint16.h" + +void snanmaxrowa(float *in, int row, int col, float* out) +{ + float inter[row]; + + + +for(int i=0; i< col; i++) + { + for(int j=0 ; j< row; j++) + { + inter[j]= in[j+ (i*row)]; + + } + out[i]= snanmaxa( inter, row); + + } + + +} diff --git a/src/c/elementaryFunctions/nanmax/znanmaxa.c b/src/c/elementaryFunctions/nanmax/znanmaxa.c new file mode 100644 index 0000000..6283bf1 --- /dev/null +++ b/src/c/elementaryFunctions/nanmax/znanmaxa.c @@ -0,0 +1,57 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nanmax.h" +#include "types.h" +#include "doubleComplex.h" +#include "abs.h" + +doubleComplex znanmaxa(doubleComplex* in, int size) +{ +doubleComplex high=0; int k=0; +for(int i=0; i<size; i++) +{ + if( !(isnan(in[i])) ) + { + high= in[i]; + break; + k= 1; + } +} + + + + for(int i=0; i< size; i++) + { + if( !(isnan(in[i])) ) + { + if( zabss(in[i]) > zabss(high)) + { + high= in[i]; + + } + + + } + + + } + + +if(k != 0) +return high; +else +return - 0.0/0.0; +} diff --git a/src/c/elementaryFunctions/nanmax/znanmaxcola.c b/src/c/elementaryFunctions/nanmax/znanmaxcola.c new file mode 100644 index 0000000..ffb96b2 --- /dev/null +++ b/src/c/elementaryFunctions/nanmax/znanmaxcola.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "nanmax.h" +#include "types.h" +#include "uint16.h" +#include "doubleComplex.h" + +void znanmaxcola(doubleComplex *in, int row, int col, doubleComplex* out) +{ + doubleComplex inter[col]; + + +for(int i=0; i< row; i++) + { + for(int j=0 ; j< col; j++) + { + inter[j]= in[i+ (j*row)]; + + } + out[i]= znanmaxa( inter, col); + + } + + +} diff --git a/src/c/elementaryFunctions/nanmax/znanmaxrowa.c b/src/c/elementaryFunctions/nanmax/znanmaxrowa.c new file mode 100644 index 0000000..e035e77 --- /dev/null +++ b/src/c/elementaryFunctions/nanmax/znanmaxrowa.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "nanmax.h" +#include "types.h" +#include "uint16.h" +#include "doubleComplex.h" + +void znanmaxrowa(doubleComplex *in, int row, int col, doubleComplex* out) +{ + doubleComplex inter[row]; + + + +for(int i=0; i< col; i++) + { + for(int j=0 ; j< row; j++) + { + inter[j]= in[j+ (i*row)]; + + } + out[i]= znanmaxa( inter, row); + + } + + +} diff --git a/src/c/elementaryFunctions/nthroot/dnthroot1a.c b/src/c/elementaryFunctions/nthroot/dnthroot1a.c new file mode 100644 index 0000000..7c65169 --- /dev/null +++ b/src/c/elementaryFunctions/nthroot/dnthroot1a.c @@ -0,0 +1,28 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nthroot.h" +#include "types.h" +void dnthroot1a(double* inp1, int irows, int icols, double inp2, double* out) +{ + + + for(int i=0; i< irows*icols; i++) + { + out[i]= dnthroots(inp1[i], inp2); + + } + +} diff --git a/src/c/elementaryFunctions/nthroot/dnthroota.c b/src/c/elementaryFunctions/nthroot/dnthroota.c new file mode 100644 index 0000000..6f33b21 --- /dev/null +++ b/src/c/elementaryFunctions/nthroot/dnthroota.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nthroot.h" +#include "types.h" +void dnthroota(double* inp1, int irows, int icols, double* inp2, int crows, int ccols, double* out) +{ + + if(irows==crows && icols==ccols) + { + for(int i=0; i< irows*icols; i++) + { + + out[i]= dnthroots(inp1[i], inp2[i]); + + } + + + + } + + + +} diff --git a/src/c/elementaryFunctions/nthroot/dnthroots.c b/src/c/elementaryFunctions/nthroot/dnthroots.c new file mode 100644 index 0000000..99beaa1 --- /dev/null +++ b/src/c/elementaryFunctions/nthroot/dnthroots.c @@ -0,0 +1,23 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nthroot.h" +#include "types.h" + +double dnthroots(double inp1, double inp2) +{ + + return pow(inp1, (1/inp2)); +} diff --git a/src/c/elementaryFunctions/nthroot/snthroot1a.c b/src/c/elementaryFunctions/nthroot/snthroot1a.c new file mode 100644 index 0000000..60fae3d --- /dev/null +++ b/src/c/elementaryFunctions/nthroot/snthroot1a.c @@ -0,0 +1,28 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nthroot.h" +#include "types.h" +void snthroot1a(float* inp1, int irows, int icols, float inp2, double* out) +{ + + + for(int i=0; i< irows*icols; i++) + { + out[i]= dnthroots(inp1[i], inp2); + + } + +} diff --git a/src/c/elementaryFunctions/nthroot/snthroota.c b/src/c/elementaryFunctions/nthroot/snthroota.c new file mode 100644 index 0000000..4a04c1d --- /dev/null +++ b/src/c/elementaryFunctions/nthroot/snthroota.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nthroot.h" +#include "types.h" +void snthroota(float* inp1, int irows, int icols, float* inp2, int crows, int ccols, double* out) +{ + + if(irows==crows && icols==ccols) + { + for(int i=0; i< irows*icols; i++) + { + + out[i]= dnthroots(inp1[i], inp2[i]); + + } + + + + } + + + +} diff --git a/src/c/elementaryFunctions/nthroot/snthroots.c b/src/c/elementaryFunctions/nthroot/snthroots.c new file mode 100644 index 0000000..ad83dac --- /dev/null +++ b/src/c/elementaryFunctions/nthroot/snthroots.c @@ -0,0 +1,23 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nthroot.h" +#include "types.h" + +double snthroots(float inp1, float inp2) +{ + + return pow(inp1, (1/inp2)); +} diff --git a/src/c/elementaryFunctions/nthroot/u16nthroot1a.c b/src/c/elementaryFunctions/nthroot/u16nthroot1a.c new file mode 100644 index 0000000..4cb654c --- /dev/null +++ b/src/c/elementaryFunctions/nthroot/u16nthroot1a.c @@ -0,0 +1,29 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nthroot.h" +#include "types.h" +#include "uint16.h" +void snthroot1a(uint16* inp1, int irows, int icols, uint16 inp2, double* out) +{ + + + for(int i=0; i< irows*icols; i++) + { + out[i]= dnthroots(inp1[i], inp2); + + } + +} diff --git a/src/c/elementaryFunctions/nthroot/u16nthroota.c b/src/c/elementaryFunctions/nthroot/u16nthroota.c new file mode 100644 index 0000000..5d178a1 --- /dev/null +++ b/src/c/elementaryFunctions/nthroot/u16nthroota.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nthroot.h" +#include "types.h" +#include "uint16.h" +void dnthroota(uint16* inp1, int irows, int icols, uint16* inp2, int crows, int ccols, double* out) +{ + + if(irows==crows && icols==ccols) + { + for(int i=0; i< irows*icols; i++) + { + + out[i]= dnthroots(inp1[i], inp2[i]); + + } + + + + } + + + +} diff --git a/src/c/elementaryFunctions/nthroot/u16nthroots.c b/src/c/elementaryFunctions/nthroot/u16nthroots.c new file mode 100644 index 0000000..618d29f --- /dev/null +++ b/src/c/elementaryFunctions/nthroot/u16nthroots.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nthroot.h" +#include "types.h" +#include "uint16.h" + +double dnthroots(uint16 inp1, uint16 inp2) +{ + + return pow(inp1, (1/inp2)); +} diff --git a/src/c/elementaryFunctions/pmodulo/dpmoduloa.c b/src/c/elementaryFunctions/pmodulo/dpmoduloa.c new file mode 100644 index 0000000..0817987 --- /dev/null +++ b/src/c/elementaryFunctions/pmodulo/dpmoduloa.c @@ -0,0 +1,32 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "pmodulo.h" +#include "types.h" +void dpmoduloa(double* inp1, int size, double* inp2, double* out) +{ + + + for(int i=0; i< size; i++) + { + + out[i]= dpmodulos(inp1[i], inp2[i]); + + } + + + + +} diff --git a/src/c/elementaryFunctions/pmodulo/dpmodulos.c b/src/c/elementaryFunctions/pmodulo/dpmodulos.c new file mode 100644 index 0000000..6144177 --- /dev/null +++ b/src/c/elementaryFunctions/pmodulo/dpmodulos.c @@ -0,0 +1,54 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "pmodulo.h" +#include "types.h" + +double dpmodulos(double inp1, double inp2) +{ + if( inp1>0 && inp2>0) + + { + return fmod(inp1,inp2); + + } + + + if( inp1>0 && inp2<0) + + { + + return fmod(inp1,inp2); + + } + + + if(inp1<0 && inp2>0) + + { + + return ((fmod(inp1,inp2))+(inp2)); + + + } + + if(inp1<0 && inp2<0) + { + + return ((fmod(inp1,inp2))-(inp2)); + + } + +} diff --git a/src/c/elementaryFunctions/pmodulo/i16pmoduloa.c b/src/c/elementaryFunctions/pmodulo/i16pmoduloa.c new file mode 100644 index 0000000..bb76d7f --- /dev/null +++ b/src/c/elementaryFunctions/pmodulo/i16pmoduloa.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "int16.h" +#include "pmodulo.h" +#include "types.h" +void i16pmoduloa(int16* inp1, int size, int16* inp2, int16* out) +{ + + + for(int i=0; i< size; i++) + { + + out[i]= i16pmodulos(inp1[i], inp2[i]); + + } + + + + +} diff --git a/src/c/elementaryFunctions/pmodulo/i16pmodulos.c b/src/c/elementaryFunctions/pmodulo/i16pmodulos.c new file mode 100644 index 0000000..f7f86c5 --- /dev/null +++ b/src/c/elementaryFunctions/pmodulo/i16pmodulos.c @@ -0,0 +1,55 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "int16.h" +#include "pmodulo.h" +#include "types.h" + +int16 i16pmodulos(int16 inp1, int16 inp2) +{ + if( inp1>0 && inp2>0) + + { + return inp1%inp2; + + } + + + if( inp1>0 && inp2<0) + + { + + return inp1%inp2; + + } + + + if(inp1<0 && inp2>0) + + { + + return ((inp1%inp2)+(inp2)); + + + } + + if(inp1<0 && inp2<0) + { + + return ((inp1%inp2)-(inp2)); + + } + +} diff --git a/src/c/elementaryFunctions/pmodulo/spmoduloa.c b/src/c/elementaryFunctions/pmodulo/spmoduloa.c new file mode 100644 index 0000000..87b2a2f --- /dev/null +++ b/src/c/elementaryFunctions/pmodulo/spmoduloa.c @@ -0,0 +1,32 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "pmodulo.h" +#include "types.h" +void spmoduloa(float* inp1, int size, float* inp2, float* out) +{ + + + for(int i=0; i< size; i++) + { + + out[i]= spmodulos(inp1[i], inp2[i]); + + } + + + + +} diff --git a/src/c/elementaryFunctions/pmodulo/spmodulos.c b/src/c/elementaryFunctions/pmodulo/spmodulos.c new file mode 100644 index 0000000..9ab6bc4 --- /dev/null +++ b/src/c/elementaryFunctions/pmodulo/spmodulos.c @@ -0,0 +1,54 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "pmodulo.h" +#include "types.h" + +float spmodulos(float inp1, float inp2) +{ + if( inp1>0 && inp2>0) + + { + return fmod(inp1,inp2); + + } + + + if( inp1>0 && inp2<0) + + { + + return fmod(inp1,inp2); + + } + + + if(inp1<0 && inp2>0) + + { + + return ((fmod(inp1,inp2))+(inp2)); + + + } + + if(inp1<0 && inp2<0) + { + + return ((fmod(inp1,inp2))-(inp2)); + + } + +} diff --git a/src/c/elementaryFunctions/nthroot/dnthroot.c b/src/c/elementaryFunctions/type/gtype index e69de29..e69de29 100644 --- a/src/c/elementaryFunctions/nthroot/dnthroot.c +++ b/src/c/elementaryFunctions/type/gtype diff --git a/src/c/hardware/rasberrypi/includes/RPIPeripheralLCD128x64.h b/src/c/hardware/rasberrypi/includes/RPIPeripheralLCD128x64.h index d541c9f..93bdf27 100644 --- a/src/c/hardware/rasberrypi/includes/RPIPeripheralLCD128x64.h +++ b/src/c/hardware/rasberrypi/includes/RPIPeripheralLCD128x64.h @@ -22,13 +22,17 @@ extern "C" { int8 RPI_lcd128x64setup(void); void u8RPI_lcd128x64clears(uint8 colour); void u8RPI_lcd128x64Orientations(uint8 orientation); + void u8RPI_lcd128x64setOrigins(uint8 x, uint8 y); + void u8RPI_lcd128x64points(uint8 x, uint8 y, uint8 colour); void u8RPI_lcd128x64lineTos(uint8 x, uint8 y, uint8 colour); + void u8RPI_lcd128x64lines(uint8 x0, uint8 y0, uint8 x1, uint8 y1, uint8 colour); void u8RPI_lcd128x64circles(uint8 x, uint8 y, uint8 r, uint8 colour, uint8 filled); void u8RPI_lcd128x64putchars(uint8 x, uint8 y, uint8 c, uint8 bgCol, uint8 fgCol); void u8RPI_lcd128x64putss(uint8 x, uint8 y, char *str,int size, uint8 bgCol, uint8 fgCol); + void u8RPI_lcd128x64rectangles(uint8 x1, uint8 y1, uint8 x2, uint8 y2, uint8 colour, uint8 filled); void u8RPI_lcd128x64ellipses(uint8 cx, uint8 cy, uint8 xRadius, uint8 yRadius, uint8 colour, uint8 filled); diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralDigital.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralDigital.h index 096fed0..6b7ed27 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralDigital.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralDigital.h @@ -28,6 +28,7 @@ extern "C" { #define d0d0RPI_digitalWrite(pin,state) u8RPI_digitalWrites(pin,state); #define u80RPI_digitalWriteByte(value) u8RPI_digitalWriteBytes(value); +#define d0RPI_digitalWriteByte(value) u8RPI_digitalWriteBytes(value); #ifdef __cplusplus } /* extern "C" */ diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralGertboard.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralGertboard.h index cea8bb6..e258068 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralGertboard.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralGertboard.h @@ -21,9 +21,15 @@ extern "C" { #endif #define RPI_gertboardSPISetupi80() RPI_gertboardSPISetup(); + #define u160RPI_gertboardAnalogSetupi80(pinBase) u16RPI_gertboardAnalogSetups(pinBase); +#define d0RPI_gertboardAnalogSetupi80(pinBase) u16RPI_gertboardAnalogSetups(pinBase); + #define u160RPI_gertboardAnalogReadu160(pin) u160RPI_gertboardAnalogReads(pin); +#define d0RPI_gertboardAnalogReadu160(pin) u160RPI_gertboardAnalogReads(pin); + #define u160u160RPI_gertboardAnalogWrite(pin,value) u160RPI_gertboardAnalogWrites(pin,value); +#define d0d0RPI_gertboardAnalogWrite(pin,value) u160RPI_gertboardAnalogWrites(pin,value); #ifdef __cplusplus } /* extern "C" */ diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralI2C.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralI2C.h index f18fd57..b93529e 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralI2C.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralI2C.h @@ -21,12 +21,25 @@ extern "C" { #endif #define u160RPI_I2CSetupi80(arrd) u16RPI_I2CSetups(arrd); +#define d0RPI_I2CSetupi80(arrd) u16RPI_I2CSetups(arrd); + #define u160RPI_I2CReadi80(fd) u16RPI_I2CReads(fd); +#define d0RPI_I2CReadi80(fd) u16RPI_I2CReads(fd); + #define u160u160RPI_I2CReadReg8i80(fd,reg) u16RPI_I2CReadReg8s(fd,reg); +#define d0d0RPI_I2CReadReg8i80(fd,reg) u16RPI_I2CReadReg8s(fd,reg); + #define u160u160RPI_I2CReadReg16i80(fd,reg) u16RPI_I2CReadReg16s(fd,reg); +#define d0d0RPI_I2CReadReg16i80(fd,reg) u16RPI_I2CReadReg16s(fd,reg); + #define u160u160RPI_I2CWritei80(fd,data) u16RPI_I2CWrites(fd,data); +#define d0d0RPI_I2CWritei80(fd,data) u16RPI_I2CWrites(fd,data); + #define u160u160u160RPI_I2CWriteReg8i80(fd,reg,data) u16RPI_I2CWriteReg8s(fd,reg,data); +#define d0d0d0RPI_I2CWriteReg8i80(fd,reg,data) u16RPI_I2CWriteReg8s(fd,reg,data); + #define u160u160u160RPI_I2CWriteReg16i80(fd,reg,data) u16RPI_I2CWriteReg16s(fd,reg,data); +#define d0d0d0RPI_I2CWriteReg16i80(fd,reg,data) u16RPI_I2CWriteReg16s(fd,reg,data); #ifdef __cplusplus } /* extern "C" */ diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD.h index e4f3ca2..803f93e 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD.h @@ -21,17 +21,47 @@ extern "C" { #endif #define u80u80u80u80u80u80u80u80u80u80RPI_lcdCharDef(fd,index,d0,d1,d2,d3,d4,d5,d6,d7) u8RPI_lcdCharDefs(fd,index,d0,d1,d2,d3,d4,d5,d6,d7); +#define u80d0d0d0d0d0d0d0d0d0RPI_lcdCharDef(fd,index,d0,d1,d2,d3,d4,d5,d6,d7) u8RPI_lcdCharDefs(fd,index,d0,d1,d2,d3,d4,d5,d6,d7); +#define d0d0d0d0d0d0d0d0d0d0RPI_lcdCharDef(fd,index,d0,d1,d2,d3,d4,d5,d6,d7) u8RPI_lcdCharDefs(fd,index,d0,d1,d2,d3,d4,d5,d6,d7); + #define u80RPI_lcdClear(fd) u8RPI_lcdClears(fd); +#define d0RPI_lcdClear(fd) u8RPI_lcdClears(fd); + #define u80u80RPI_lcdCursorBlink(fd,state) u8RPI_lcdCursorBlinks(fd,state); +#define u80d0RPI_lcdCursorBlink(fd,state) u8RPI_lcdCursorBlinks(fd,state); +#define d0d0RPI_lcdCursorBlink(fd,state) u8RPI_lcdCursorBlinks(fd,state); + #define u80u80RPI_lcdCursor(fd,state) u8RPI_lcdCursors(fd,state); +#define u80d0RPI_lcdCursor(fd,state) u8RPI_lcdCursors(fd,state); +#define d0d0RPI_lcdCursor(fd,state) u8RPI_lcdCursors(fd,state); + #define u80u80RPI_lcdDisplay(fd,state) u8RPI_lcdDisplays(fd,state); +#define u80d0RPI_lcdDisplay(fd,state) u8RPI_lcdDisplays(fd,state); +#define d0d0RPI_lcdDisplay(fd,state) u8RPI_lcdDisplays(fd,state); + #define u80RPI_lcdHome(fd) u8RPI_lcdHomes(fd); +#define d0RPI_lcdHome(fd) u8RPI_lcdHomes(fd); + #define u80u80u80u80u80u80u80u80u80u80u80u80u80RPI_lcdIniti80(rows,cols,bits,rs,strb,d0,d1,d2,d3,d4,d5,d6,d7) u8RPI_lcdInits(rows,cols,bits,rs,strb,d0,d1,d2,d3,d4,d5,d6,d7); +#define d0d0d0d0d0d0d0d0d0d0d0d0d0RPI_lcdIniti80(rows,cols,bits,rs,strb,d0,d1,d2,d3,d4,d5,d6,d7) u8RPI_lcdInits(rows,cols,bits,rs,strb,d0,d1,d2,d3,d4,d5,d6,d7); + #define u80u80u80RPI_lcdPosition(fd,row,col) u8RPI_lcdPositions(fd,row,col); +#define u80d0d0RPI_lcdPosition(fd,row,col) u8RPI_lcdPositions(fd,row,col); +#define d0d0d0RPI_lcdPosition(fd,row,col) u8RPI_lcdPositions(fd,row,col); + #define u80u80RPI_lcdPutchar(fd,char) u8RPI_lcdPutchars(fd,char); +#define u80d0RPI_lcdPutchar(fd,char) u8RPI_lcdPutchars(fd,char); +#define d0d0RPI_lcdPutchar(fd,char) u8RPI_lcdPutchars(fd,char); + #define u80u80RPI_lcdSendCommand(fd,cmd) u8RPI_lcdSendCommands(fd,cmd); +#define u80d0RPI_lcdSendCommand(fd,cmd) u8RPI_lcdSendCommands(fd,cmd); +#define d0d0RPI_lcdSendCommand(fd,cmd) u8RPI_lcdSendCommands(fd,cmd); + #define u80g2RPI_lcdPuts(fd,msg,size) u8RPI_lcdPutss(fd,msg,size[1]);; +#define d0g2RPI_lcdPuts(fd,msg,size) u8RPI_lcdPutss(fd,msg,size[1]);; + #define u80g2RPI_lcdPrintf(fd,data,size) u8RPI_lcdPrintfs(fd,data,size[1]); +#define d0g2RPI_lcdPrintf(fd,data,size) u8RPI_lcdPrintfs(fd,data,size[1]); #ifdef __cplusplus } /* extern "C" */ diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD128x64.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD128x64.h index 46b6328..8bb4b17 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD128x64.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD128x64.h @@ -33,13 +33,16 @@ extern "C" { #define u80u80u80RPI_lcd128x64point(x,y,colour) u8RPI_lcd128x64points(x,y,colour); #define d0d0d0RPI_lcd128x64point(x,y,colour) u8RPI_lcd128x64points(x,y,colour); + #define u80u80u80RPI_lcd128x64lineTo(x,y,colour) u8RPI_lcd128x64lineTos(x,y,colour); #define d0d0d0RPI_lcd128x64lineTo(x,y,colour) u8RPI_lcd128x64lineTos(x,y,colour); #define u80u80u80u80u80RPI_lcd128x64line(x0,y0,x1,y1,colour) u8RPI_lcd128x64lines(x0,y0,x1,y1,colour); #define d0d0d0d0d0RPI_lcd128x64line(x0,y0,x1,y1,colour) u8RPI_lcd128x64lines(x0,y0,x1,y1,colour); + #define u80u80u80u80u80RPI_lcd128x64circle(x,y,r,colour,filled) u8RPI_lcd128x64circles(x,y,r,colour,filled); #define d0d0d0d0d0RPI_lcd128x64circle(x,y,r,colour,filled) u8RPI_lcd128x64circles(x,y,r,colour,filled); + #define u80u80u80u80u80RPI_lcd128x64putchar(x,y,c,bgCol,fgCol) u8RPI_lcd128x64putchars(x,y,c,bgCol,fgCol); #define d0d0d0d0u80RPI_lcd128x64putchar(x,y,c,bgCol,fgCol) u8RPI_lcd128x64putchars(x,y,c,bgCol,fgCol); @@ -48,6 +51,7 @@ extern "C" { #define u80u80u80u80u80u80RPI_lcd128x64rectangle(x1,y1,x2,y2,colour,filled) u8RPI_lcd128x64rectangles(x1,y1,x2,y2,colour,filled); #define d0d0d0d0d0d0RPI_lcd128x64rectangle(x1,y1,x2,y2,colour,filled) u8RPI_lcd128x64rectangles(x1,y1,x2,y2,colour,filled); + #define u80u80u80u80u80u80RPI_lcd128x64ellipse(cx,cy,xRadius,yRadius,colour,filled) u8RPI_lcd128x64ellipses(cx,cy,xRadius,yRadius,colour,filled); #define d0d0d0d0d0d0RPI_lcd128x64ellipse(cx,cy,xRadius,yRadius,colour,filled) u8RPI_lcd128x64ellipses(cx,cy,xRadius,yRadius,colour,filled); diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralMcp.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralMcp.h index c044cf7..7857b3a 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralMcp.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralMcp.h @@ -21,10 +21,19 @@ extern "C" { #endif #define u160u80RPI_mcp23008Setupu80(pinBase,addr) u16RPI_mcp23008Setups(pinBase,addr); +#define d0d0RPI_mcp23008Setupu80(pinBase,addr) u16RPI_mcp23008Setups(pinBase,addr); + #define u160u80RPI_mcp23016Setupu80(pinBase,addr) u16RPI_mcp23016Setups(pinBase,addr); +#define d0d0RPI_mcp23016Setupu80(pinBase,addr) u16RPI_mcp23016Setups(pinBase,addr); + #define u160u80RPI_mcp23017Setupu80(pinBase,addr) u16RPI_mcp23017Setups(pinBase,addr); +#define d0d0RPI_mcp23017Setupu80(pinBase,addr) u16RPI_mcp23017Setups(pinBase,addr); + #define u160u80u80RPI_mcp23s08Setupu80(pinBase,spiport,devId) u16RPI_mcp23s08Setups(pinBase,spiport,devId); +#define d0d0d0RPI_mcp23s08Setupu80(pinBase,spiport,devId) u16RPI_mcp23s08Setups(pinBase,spiport,devId); + #define u160u80u80RPI_mcp23s17Setupu80(pinBase,spiport,devId) u16RPI_mcp23s17Setups(pinBase,spiport,devId); +#define d0d0d0RPI_mcp23s17Setupu80(pinBase,spiport,devId) u16RPI_mcp23s17Setups(pinBase,spiport,devId); #ifdef __cplusplus } /* extern "C" */ diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralMisc.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralMisc.h index b836d68..de065a2 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralMisc.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralMisc.h @@ -21,8 +21,12 @@ extern "C" { #endif #define RPI_boardRevu80() RPI_boardRev(); + #define u80u80RPI_padDrive(group,strength) u8RPI_padDrives(group,strength); +#define d0d0RPI_padDrive(group,strength) u8RPI_padDrives(group,strength); + #define u160RPI_sn3218Setupi80(pinBase) u16RPI_sn3218Setups(pinBase); +#define d0RPI_sn3218Setupi80(pinBase) u16RPI_sn3218Setups(pinBase); #ifdef __cplusplus } /* extern "C" */ diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPWM.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPWM.h index 49c58c0..fd1a1b0 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPWM.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPWM.h @@ -21,10 +21,18 @@ extern "C" { #endif #define u80u160RPI_pwmWrite(pin,value) u8RPI_pwmWrites(pin,value); +#define d0d0RPI_pwmWrite(pin,value) u8RPI_pwmWrites(pin,value); + #define u320RPI_pwmRange(value) u32RPI_pwmRanges(value); +#define d0RPI_pwmRange(value) u32RPI_pwmRanges(value); + #define g2RPI_pwmMode(mode) gRPI_pwmModea(mode); + #define u160RPI_pwmClock(divisor) u16RPI_pwmClocks(divisor); +#define d0RPI_pwmClock(divisor) u16RPI_pwmClocks(divisor); + #define u80u160RPI_pwmToneWrite(pin,value) u8RPI_pwmToneWrites(pin,value); +#define d0d0RPI_pwmToneWrite(pin,value) u8RPI_pwmToneWrites(pin,value); #ifdef __cplusplus } /* extern "C" */ diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPcf.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPcf.h index e3d2009..3d0cb27 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPcf.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPcf.h @@ -21,7 +21,10 @@ extern "C" { #endif #define u160u80RPI_pcf8574Setupu80(pinBase,addr) u16RPI_pcf8574Setups(pinBase,addr); +#define d0d0RPI_pcf8574Setupu80(pinBase,addr) u16RPI_pcf8574Setups(pinBase,addr); + #define u160u80RPI_pcf8591Setupu80(pinBase,addr) u16RPI_pcf8591Setups(pinBase,addr); +#define d0d0RPI_pcf8591Setupu80(pinBase,addr) u16RPI_pcf8591Setups(pinBase,addr); #ifdef __cplusplus } /* extern "C" */ diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPiGlow.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPiGlow.h index 08056f9..8e268f6 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPiGlow.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPiGlow.h @@ -21,9 +21,16 @@ extern "C" { #endif #define u80RPI_piGlowSetup(clear) u8RPI_piGlowSetups(clear); +#define d0RPI_piGlowSetup(clear) u8RPI_piGlowSetups(clear); + #define u80u80u80RPI_piGlow1(leg,ring,intensity) u8RPI_piGlow1s(leg,ring,intensity); +#define d0d0d0RPI_piGlow1(leg,ring,intensity) u8RPI_piGlow1s(leg,ring,intensity); + #define u80u80RPI_piGlowLeg(leg,intensity) u8RPI_piGlowLegs(leg,intensity); +#define d0d0RPI_piGlowLeg(leg,intensity) u8RPI_piGlowLegs(leg,intensity); + #define u80u80RPI_piGlowRing(ring,intensity) u8RPI_piGlowRings(ring,intensity); +#define d0d0RPI_piGlowRing(ring,intensity) u8RPI_piGlowRings(ring,intensity); #ifdef __cplusplus } /* extern "C" */ diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPinMap.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPinMap.h index 39c5c01..8de0dc2 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPinMap.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPinMap.h @@ -21,7 +21,10 @@ extern "C" { #endif #define u80RPI_physToGpioi80(pin) u8RPI_physToGpios(pin); +#define d0RPI_physToGpioi80(pin) u8RPI_physToGpios(pin); + #define u80RPI_wpiToGpioi80(pin) u8RPI_wpiToGpios(pin); +#define d0RPI_wpiToGpioi80(pin) u8RPI_wpiToGpios(pin); #ifdef __cplusplus } /* extern "C" */ diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSerial.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSerial.h index e0832f9..b308d83 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSerial.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSerial.h @@ -21,13 +21,28 @@ extern "C" { #endif #define g2u320RPI_serialOpeni80(device,size,baud) gRPI_serialOpena(device,size[1],baud); +#define g2d0RPI_serialOpeni80(device,size,baud) gRPI_serialOpena(device,size[1],baud); + #define u80RPI_serialClose(fd) u8RPI_serialCloses(fd); +#define d0RPI_serialClose(fd) u8RPI_serialCloses(fd); + #define u80RPI_serialDataAvailu80(fd) u8RPI_serialDataAvails(fd); +#define d0RPI_serialDataAvailu80(fd) u8RPI_serialDataAvails(fd); + #define u80RPI_serialFlush(fd) u8RPI_serialFlushs(fd); +#define d0RPI_serialFlush(fd) u8RPI_serialFlushs(fd); + #define u80RPI_serialGetcharg2(fd,out) u8RPI_serialGetchars(fd,out); +#define d0RPI_serialGetcharg2(fd,out) u8RPI_serialGetchars(fd,out); + #define u80g2RPI_serialPrintf(fd,msg,size) u8RPI_serialPrintfs(fd,msg,size[1]); +#define d0g2RPI_serialPrintf(fd,msg,size) u8RPI_serialPrintfs(fd,msg,size[1]); + #define u80u80RPI_serialPutchar(fd,character) u8RPI_serialPutchars(fd,character); +#define d0d0RPI_serialPutchar(fd,character) u8RPI_serialPutchars(fd,character); + #define u80g2RPI_serialPutsg2(fd,character,size) u8RPI_serialPutss(fd,character,size[1]); +#define d0g2RPI_serialPutsg2(fd,character,size) u8RPI_serialPutss(fd,character,size[1]); #ifdef __cplusplus } /* extern "C" */ diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSetup.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSetup.h index bd82702..6bcb163 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSetup.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSetup.h @@ -23,18 +23,12 @@ extern "C" { #define g2RPI_pinNumberingi80(seq,size) gRPI_pinNumberinga(seq,size[1]); //getAlt #define u80RPI_getAltu80(pin) u8RPI_getAlts(pin); -#define u160RPI_getAltu80(pin) u8RPI_getAlts(pin); -#define u320RPI_getAltu80(pin) u8RPI_getAlts(pin); #define d0RPI_getAltu80(pin) u8RPI_getAlts(pin); //pinModeAlt #define u80u80RPI_pinModeAlt(pin,mode) u8RPI_pinModeAlts(pin,mode); -#define u160u160RPI_pinModeAlt(pin,mode) u8RPI_pinModeAlts(pin,mode); -#define u320u320RPI_pinModeAlt(pin,mode) u8RPI_pinModeAlts(pin,mode); #define d0d0RPI_pinModeAlt(pin,mode) u8RPI_pinModeAlts(pin,mode); //pinMode #define u80g2RPI_pinMode(pin,mode,size) u8RPI_pinModes(pin,mode,size[1]); -#define u160g2RPI_pinMode(pin,mode,size) u8RPI_pinModes(pin,mode,size[1]); -#define u320g2RPI_pinMode(pin,mode,size) u8RPI_pinModes(pin,mode,size[1]); #define d0g2RPI_pinMode(pin,mode,size) u8RPI_pinModes(pin,mode,size[1]); //pullControl #define u80g2RPI_pullControl(pin,mode,size) u8RPI_pullControls(pin,mode,size[1]); diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralShift.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralShift.h index 6b142bd..7b70ce9 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralShift.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralShift.h @@ -21,8 +21,13 @@ extern "C" { #endif #define u80u80u80RPI_shiftInu80(dpin,cpin,order) u8RPI_shiftIns(dpin,cpin,order); +#define d0d0d0RPI_shiftInu80(dpin,cpin,order) u8RPI_shiftIns(dpin,cpin,order); + #define u80u80u80u80RPI_shiftOut(dpin,cpin,order,val) u8RPI_shiftOuts(dpin,cpin,order,val); +#define d0d0d0d0RPI_shiftOut(dpin,cpin,order,val) u8RPI_shiftOuts(dpin,cpin,order,val); + #define u160u80u80u80u80RPI_sr595Setupi80(pinBase,nPins,dP,cP,lP) u16RPI_sr595Setups(pinBase,nPins,dP,cP,lP); +#define d0d0d0d0d0RPI_sr595Setupi80(pinBase,nPins,dP,cP,lP) u16RPI_sr595Setups(pinBase,nPins,dP,cP,lP); #ifdef __cplusplus } /* extern "C" */ diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSoft.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSoft.h index 80372b2..646c524 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSoft.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSoft.h @@ -21,11 +21,22 @@ extern "C" { #endif #define u80u160u160RPI_softPwmCreateu80(pin,ival,range) u8RPI_softPwmCreates(pin,ival,range); +#define d0d0d0RPI_softPwmCreateu80(pin,ival,range) u8RPI_softPwmCreates(pin,ival,range); + #define u80RPI_softPwmStop(pin) u8RPI_softPwmStops(pin); +#define d0RPI_softPwmStop(pin) u8RPI_softPwmStops(pin); + #define u80u160RPI_softPwmWrite(pin,value) u8RPI_softPwmWrites(pin,value); +#define d0d0RPI_softPwmWrite(pin,value) u8RPI_softPwmWrites(pin,value); + #define u80RPI_softToneCreateu80(pin) u8RPI_softToneCreates(pin); +#define d0RPI_softToneCreateu80(pin) u8RPI_softToneCreates(pin); + #define u80RPI_softToneStop(pin) u8RPI_softToneStops(pin); +#define d0RPI_softToneStop(pin) u8RPI_softToneStops(pin); + #define u80u320RPI_softToneWrite(pin,value) u8RPI_softToneWrites(pin,value); +#define d0d0RPI_softToneWrite(pin,value) u8RPI_softToneWrites(pin,value); #ifdef __cplusplus } /* extern "C" */ diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralTiming.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralTiming.h index d2fae23..cbbb47a 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralTiming.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralTiming.h @@ -24,6 +24,8 @@ extern "C" { #define d0RPI_delay(time) u32RPI_delays(time); #define u320RPI_delayMicro(time) u32RPI_delayMicros(time); +#define d0RPI_delayMicro(time) u32RPI_delayMicros(time); + #define RPI_millisu320() RPI_millis(); #define RPI_microsu320() RPI_micros(); diff --git a/src/c/hardware/rasberrypi/pwm/u8RPI_pwmToneWrites.c b/src/c/hardware/rasberrypi/pwm/u8RPI_pwmToneWrites.c index fe1b8cd..3fe0c82 100644 --- a/src/c/hardware/rasberrypi/pwm/u8RPI_pwmToneWrites.c +++ b/src/c/hardware/rasberrypi/pwm/u8RPI_pwmToneWrites.c @@ -12,6 +12,6 @@ #include "RPIPeripheralPWM.h" -void u8RPI_pwmToneWrites(uint8 pin, uint16 value){ - pwmToneWrite(pin, value); +void u8RPI_pwmToneWrites(uint8 pin,uint16 freq){ + pwmToneWrite(pin,freq); } diff --git a/src/c/linearAlgebra/fullrf/dfullrfa.c b/src/c/linearAlgebra/fullrf/dfullrfa.c new file mode 100644 index 0000000..a409ae3 --- /dev/null +++ b/src/c/linearAlgebra/fullrf/dfullrfa.c @@ -0,0 +1,112 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +/* FULL Rank factorization function in scilab */ + +/* + //[Q,M,rk]=fullrf(A) + //Full rank factorization : A=Q.M + //with range(Q)=range(A) and ker(M)=ker(A), + //Q full column rank , M full row rank + // rk = rank(A) = #columns(Q) = #rows(M) + //F.D. +*/ + +#include "fullrf.h" +#include <stdio.h> +#include <stdlib.h> +#include "svd.h" +#include <math.h> +#include "norm.h" +#include "matrixTranspose.h" +#include "matrixMultiplication.h" + +double dfullrfa(int ninp,double *inp1,int row,int col,double tol,double *out1,double *out2){ + + int i,j; + /* norm inp1 - norm(inp1,1)*/ + double na1; + na1 = dnorma(inp1,row,col,1); + + if(ninp == 1){ + tol = sqrt(pow(2,-52)); + } + + if(na1 < pow(1,-10)){ + out1 = NULL; + out2 = NULL; + return 0; + } + + double tol1; + tol1 = tol*na1; + + double *U,*S,*V; + U = (double *)malloc(row*row*sizeof(double)); + S = (double *)malloc(row*col*sizeof(double)); + V = (double *)malloc(col*col*sizeof(double)); + + double rk; + rk = dsvda(tol1,inp1,row,col,0,4,U,S,V); + + /* sq = sqrt(s) */ + for(i=0;i<row;i++){ + for(j=0;j<col;j++){ + if(i == j){ + S[i*row+j] = pow(S[i*row+j],0.5); + } + else{ + S[i*row+j] = 0; + } + } + } + + double *Q; + Q = (double *)malloc(row*col*sizeof(double)); + dmulma(U,row,row,S,row,col,Q); + + double *VT; + VT = (double *)malloc(col*col*sizeof(double)); + dtransposea(V,col,col,VT); + + /* multiplication of sq*V' or S*VT */ + double *M; + M = (double *)malloc(row*col*sizeof(double)); + dmulma(S,row,col,VT,col,col,M); + + /* This Program is not yet completed properly, as it outputs the whole matrix, instead of the exact output. + + if anyone finds, how to fix the size in INITFILLscidir.sci +please change there and change below few lines of codes accordingly. + +*/ + for(i=0;i<row;i++){ + for(j=0;j<col;j++){ + //if(j < rk) + out1[i*col+j] = Q[i*col+j]; + //else + // out1[i*col+j] = 0; + } + //printf("\n"); + } + + for(i=0;i<row;i++){ + for(j=0;j<col;j++){ + //if(i < rk) + out2[i*col+j] = M[i*col+j]; + //else + // out2[i*col+j] = 0; + } + } + + return rk; +} diff --git a/src/c/linearAlgebra/givens/dgivensa.c b/src/c/linearAlgebra/givens/dgivensa.c new file mode 100644 index 0000000..9bf0637 --- /dev/null +++ b/src/c/linearAlgebra/givens/dgivensa.c @@ -0,0 +1,76 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +/* GIVENS scilab function + Syntax : u=givens(xy) + u=givens(x,y) + xy = [x;y], u=givens(xy) + returns a 2*2 matrix u such that u*xy=[r;0]. + c is equal to u*xy + givens(x,y)=givens([x;y]) +*/ + +#include "givens.h" +#include <stdio.h> +#include <math.h> +#include "norm.h" + +/* All variable names are according to scilab code */ + +void dgivensa(int ninp,double *inp1,int row,int col,double *inp2,int row1,int col1,int nout,double *out1,double *out2){ + double *x; + double r; + x = (double *)malloc((double)2*sizeof(double)); + if(ninp == 2){ + if(row != 1 || col != 1 || row1 != 1 || col1 != 1){ + printf("Wrong size for input argument: A column vector expected.\n"); + return; + } + *(x) = *(inp1); + *(x+1) = *(inp2); + } + else{ + //printf("(%d %d)",row,col); + if(row != 2 || col != 1){ + printf("Wrong size for input argument: A column vector expected.\n"); + return; + } + //printf("(%lf %lf)",inp1[0],inp1[1]); + x[0] = inp1[0]; + x[1] = inp1[1]; + } + if(*(x+1) != 0){ + //printf("(%lf %lf)",x[0],x[1]); + /*Norm of type 2 - find the maximum singular value*/ + r = dnorma(x,2,1,2); + //printf("%lf \n",r); + *(out1) = (*(x))/r; + *(out1+1) = -(*(x+1))/r; + *(out1+2) = (*(x+1))/r; + *(out1+3) = (*(x))/r; + if(nout == 2){ + *(out2) = r; + *(out2+1) = 0; + } + + } + else{ + *(out1) = 1; + *(out1+1) = 0; + *(out1+2) = 1; + *(out1+3) = 0; + if(nout == 2){ + *(out2) = *(x); + *(out2+1) = *(x+1); + } + } +} diff --git a/src/c/linearAlgebra/hess/dhessa.c b/src/c/linearAlgebra/hess/dhessa.c index 57f81b3..e1f2e2d 100644 --- a/src/c/linearAlgebra/hess/dhessa.c +++ b/src/c/linearAlgebra/hess/dhessa.c @@ -20,11 +20,13 @@ #include "matrixTranspose.h" #include "matrixMultiplication.h" +/* Lapack subroutines - which are used*/ extern int dgehrd_(int *, int *,int *,double *,int *,double *,double *,int *,int *); extern int dorghr_(int *, int *,int *,double *,int *,double *,double *,int *,int *); - +/* All the vairbale names are given exactly the same name as scilab source code */ void dhessa(double *in1,int size,int nout,double *out1, double *out2){ +/* Variables names are done through, Lapack library. */ int i,j,k; int N = size; int ILO=1; @@ -41,11 +43,11 @@ void dhessa(double *in1,int size,int nout,double *out1, double *out2){ WORK = (double *)malloc((double)LWORK*sizeof(double)); dgehrd_(&N,&ILO,&IHI,A,&LDA,TAU,WORK,&N,&INFO); - for(i=0;i<N;i++) + for(i=0;i<N;i++) /* copying it in output */ for(j=0;j<N;j++) out2[i+j*N] = A[i+j*N]; - for(j=1;j<=N-2;j++){ + for(j=1;j<=N-2;j++){ /* copying it in output */ for(i=j+2;i<=N;i++){ out2[(i-1)+(j-1)*N] = 0; } diff --git a/src/c/linearAlgebra/householder/dhouseholdera.c b/src/c/linearAlgebra/householder/dhouseholdera.c new file mode 100644 index 0000000..5a98bfa --- /dev/null +++ b/src/c/linearAlgebra/householder/dhouseholdera.c @@ -0,0 +1,90 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +/* Householder orthogonal reflexion matrix */ + +/* +Syntax :- + //u=householder(v [,w]) + //Description + //given 2 column vectors v w of same size householder(v,w) returns a unitary + //column vector u, such that (eye-2*u*u')*v is proportional to w. + //(eye-2*u*u') is the orthogonal Householder reflexion matrix + // + // w default value is eye(v). In this case vector (eye-2*u*u')*v is the + // vector eye(v)*(+-norm(v)) +*/ +#include <stdio.h> +#include <stdlib.h> +#include "householder.h" +#include "eye.h" +#include "matrixTranspose.h" +#include "matrixMultiplication.h" +#include <math.h> +#include "norm.h" + +void dhouseholdera(int ninp,double *inp1,int row,double *inp2,double *out1){ + + int i,j; + double *x; + x = (double *)malloc(row*sizeof(double)); + + for(i=0;i<row;i++) + x[i] = inp1[i]; + + if(ninp < 2){ + deyea(x,row,1); + } + else{ + for(i=0;i<row;i++){ + x[i] = inp2[i]; + } + } + + /* vt transpose of inp1 */ + + double *vt; + vt = (double *)malloc(row*sizeof(double)); + dtransposea(inp1,row,1,vt); + + /*wt transpose of inp2 */ + double *wt; + wt = (double *)malloc(row*sizeof(double)); + dtransposea(x,row,1,wt); + + /* vvt = inp1*vt */ + double *vvt; + vvt = (double *)malloc(1*1*sizeof(double)); + dmulma(vt,1,row,inp1,row,1,vvt); + + /* wwt = inp2*wt */ + double *wwt; + wwt = (double *)malloc(1*1*sizeof(double)); + dmulma(wt,1,row,x,row,1,wwt); + + /* a=-sqrt((v'*v)/(w'*w)) */ + double a; + //a = (double *)malloc(1*1*sizeof(double)); + a = -sqrt(vvt[0]/wwt[0]); + + for(i=0;i<row;i++){ + out1[i] = x[i]*a+inp1[i]; + } + + /* norm of out1 */ + double r; + r = dnorma(out1,row,1,2); + + for(i=0;i<row;i++){ + out1[i]=out1[i]/r; + } +} diff --git a/src/c/linearAlgebra/includes/fullrf.h b/src/c/linearAlgebra/includes/fullrf.h new file mode 100644 index 0000000..cc0a33d --- /dev/null +++ b/src/c/linearAlgebra/includes/fullrf.h @@ -0,0 +1,26 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __FULLRF_H__ +#define __FULLRF_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dfullrfa(int ninp,double *in1,int row,int col,double tol,double *out1,double *out2); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__FULLRF_H__*/ diff --git a/src/c/linearAlgebra/includes/givens.h b/src/c/linearAlgebra/includes/givens.h new file mode 100644 index 0000000..4aac91b --- /dev/null +++ b/src/c/linearAlgebra/includes/givens.h @@ -0,0 +1,25 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __GIVENS_H__ +#define __GIVENS_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +void dgivensa(int ninp,double *inp1,int row,int col,double *inp2,int row1,int col1,int nout,double *out1,double *out2); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__givens_H__*/ diff --git a/src/c/linearAlgebra/includes/householder.h b/src/c/linearAlgebra/includes/householder.h new file mode 100644 index 0000000..64350a1 --- /dev/null +++ b/src/c/linearAlgebra/includes/householder.h @@ -0,0 +1,26 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __HOUSEHOLDER_H__ +#define __HOUSEHOLDER_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dhouseholdera(int ninp,double *inp1,int row,double *inp2,double *out1); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__HOUSEHOLDER_H__*/ diff --git a/src/c/linearAlgebra/includes/qr.h b/src/c/linearAlgebra/includes/qr.h new file mode 100644 index 0000000..2ed12e3 --- /dev/null +++ b/src/c/linearAlgebra/includes/qr.h @@ -0,0 +1,26 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __QR_H__ +#define __QR_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dqra(int ninp,int nout,double *inp1,int M,int N,double tol,double *out1,double *out2,double *out3); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__QR_H__*/ diff --git a/src/c/linearAlgebra/includes/rowcomp.h b/src/c/linearAlgebra/includes/rowcomp.h new file mode 100644 index 0000000..faf5a2a --- /dev/null +++ b/src/c/linearAlgebra/includes/rowcomp.h @@ -0,0 +1,26 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __ROWCOMP_H__ +#define __ROWCOMP_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double drowcompa(int ninp,double *A,int row,int col,char *flag,double tol,double *w); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__ROWCOMP_H__*/ diff --git a/src/c/linearAlgebra/includes/sqroot.h b/src/c/linearAlgebra/includes/sqroot.h new file mode 100644 index 0000000..9c1d965 --- /dev/null +++ b/src/c/linearAlgebra/includes/sqroot.h @@ -0,0 +1,26 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __SQROOT_H__ +#define __SQROOT_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dsqroota(double *inp,int row,int col,double *out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__SQROOT_H__*/ diff --git a/src/c/linearAlgebra/interfaces/int_fullrf.h b/src/c/linearAlgebra/interfaces/int_fullrf.h new file mode 100644 index 0000000..1b8a067 --- /dev/null +++ b/src/c/linearAlgebra/interfaces/int_fullrf.h @@ -0,0 +1,28 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __INT_FULLRF_H__ +#define __INT_FULLRF_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2fullrfd2d2d0(in1,size,out1,out2) dfullrfa(1,in1,size[0],size[1],0,out1,out2); +#define d2d0fullrfd2d2d0(in1,size,in2,out1,out2) dfullrfa(2,in1,size[0],size[1],in2,out1,out2); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_FULLRF_H__*/ + diff --git a/src/c/linearAlgebra/interfaces/int_givens.h b/src/c/linearAlgebra/interfaces/int_givens.h new file mode 100644 index 0000000..ba30dbc --- /dev/null +++ b/src/c/linearAlgebra/interfaces/int_givens.h @@ -0,0 +1,32 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __INT_GIVENS_H__ +#define __INT_GIVENS_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2givensd2(in1,size,out1) dgivensa(1,in1,size[0],size[1],NULL,0,0,1,out1,NULL); +#define d2givensd2d2(in1,size,out1,out2) dgivensa(1,in1,size[0],size[1],NULL,0,0,2,out1,out2); + +#define d0d0givensd2d2(in1,in2,out1,out2) dgivensa(2,&in1,1,1,&in2,1,1,2,out1,out2); +#define d0d0givensd2(in1,out1) dgivensa(2,&in1,1,1,&in2,1,1,1,out1,NULL); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_GIVENS_H__*/ + diff --git a/src/c/linearAlgebra/interfaces/int_householder.h b/src/c/linearAlgebra/interfaces/int_householder.h new file mode 100644 index 0000000..f863719 --- /dev/null +++ b/src/c/linearAlgebra/interfaces/int_householder.h @@ -0,0 +1,28 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __INT_HOUSEHOLDER_H__ +#define __INT_HOUSEHOLDER_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2householderd2(in1,size,out1) dhouseholdera(1,in1,size[0],NULL,out2); +#define d2d2householderd2(in1,size1,in2,size2,out1) dhouseholdera(2,in1,size1[0],in2,out1); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_HOUSEHOLDER_H__*/ + diff --git a/src/c/linearAlgebra/interfaces/int_qr.h b/src/c/linearAlgebra/interfaces/int_qr.h new file mode 100644 index 0000000..d34d8f4 --- /dev/null +++ b/src/c/linearAlgebra/interfaces/int_qr.h @@ -0,0 +1,34 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __INT_QR_H__ +#define __INT_QR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2qrd2d2(in1,size,out1,out2) dqra(1,2,in1,size[0],size[1],0,out1,out2,NULL); +#define d2qrd2d2d2(in1,size,out1,out2,out3) dqra(1,3,in1,size[0],size[1],0,out1,out2,out3); +#define d2g2qrd2d2(in1,size,in2,size1,out1,out2) dqra(2,2,in1,size[0],size[1],0,out1,out2,NULL); +#define d2g2qrd2d2d2(in1,size,in2,size1,out1,out2,out3) dqra(2,3,in1,size[0],size[1],0,out1,out2,out3); +#define d2d0qrd2d2d0d2(in1,size,in2,out1,out2,out3) dqra(2,4,in1,size[0],size[1],in2,out1,out2,out3); +#define d2qrd2d2d0d2(in1,size,out1,out2,out3) dqra(1,4,in1,size[0],size[1],0,out1,out2,out3); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_HESS_H__*/ + diff --git a/src/c/linearAlgebra/interfaces/int_rowcomp.h b/src/c/linearAlgebra/interfaces/int_rowcomp.h new file mode 100644 index 0000000..b72687d --- /dev/null +++ b/src/c/linearAlgebra/interfaces/int_rowcomp.h @@ -0,0 +1,29 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __INT_ROWCOMP_H__ +#define __INT_ROWCOMP_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2rowcompd2d0(in1,size,out1) drowcompa(1,in1,size[0],size[1],NULL,0,out1); +#define d2g2rowcompd2d0(in1,size,flag,size1,out1) drowcompa(2,in1,size[0],size[1],flag,0,out1); +#define d2g2d0rowcompd2d0(in1,size,flag,size1,tol,out1) drowcompa(2,in1,size[0],size[1],flag,tol,out1); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_ROWCOMP_H__*/ + diff --git a/src/c/linearAlgebra/interfaces/int_sqroot.h b/src/c/linearAlgebra/interfaces/int_sqroot.h new file mode 100644 index 0000000..57af2c0 --- /dev/null +++ b/src/c/linearAlgebra/interfaces/int_sqroot.h @@ -0,0 +1,27 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __INT_SQROOT_H__ +#define __INT_SQROOT_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2sqrootd2(inp,size,out) dsqroota(inp,size[0],size[1],out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_HESS_H__*/ + diff --git a/src/c/linearAlgebra/proj/dproja.c b/src/c/linearAlgebra/proj/dproja.c new file mode 100644 index 0000000..e27cd6f --- /dev/null +++ b/src/c/linearAlgebra/proj/dproja.c @@ -0,0 +1,73 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +/* Scilab function proj code in C */ + +#include <stdio.h> +#include <stdlib.h> +#include "proj.h" +#include "eye.h" +#include "matrixTranspose.h" +#include "matrixMultiplication.h" +#include <math.h> +#include "norm.h" + + +double dproja(double *x1,int l,int k,double *x2,int m2,int n2,double *y){ + int i,j; + double *w; + w = (double *)malloc(l*l*sizeof(double)); + double rk; + rk = drowcompa(1,x1,l,k,NULL,0,w); + + double *w1; + w1 = (double *)malloc(rk*l*sizeof(double)); + + for(i=0;i<l*rk;i++){ + w1[i]=w[i]; + } + + double *x1t; + x1t = (double *)malloc((l-n)*l*sizeof(double); + + for(i=n;i<l;i++){ + for(j=0;j<l;j++){ + x1t[i-n+j*l] = w1[i+j*l]; + } + } + + double x1x2; + x1x2 = (double *)malloc((l-n+1)*n2*sizeof(double)); + dmulma(x1t,l-n+1,l,x2,m2,n2,x1x2); + + double *inx1x2; + inx1x2 = (double *)malloc(); + + + + + + + + + + + + + + + + + + + +} diff --git a/src/c/linearAlgebra/projspec/dprojspeca.c b/src/c/linearAlgebra/projspec/dprojspeca.c new file mode 100644 index 0000000..aea9713 --- /dev/null +++ b/src/c/linearAlgebra/projspec/dprojspeca.c @@ -0,0 +1,67 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +/* PROJSPEC function in scilab */ + +/* + //[S,P,D,index]=projspec(A) + //Spectral characteristics of A at 0 + //S = reduced resolvent at 0 (S=-Drazin_inverse(A)) + //P = spectral projection at 0 + //D = Nilpotent operator at 0 + //index = index of the 0 eigenvalue + //! + +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "norm.h" +#include "eye.h" + +#define eps pow(2,-52) + +double dprojspeca(double *inp1,int row,int col,double *out1,double *out2,double *out3){ + double tol = pow(10,-6); + int i,j,index; + /*norm(A,1)*/ + double nor; + nor = dnorma(inp1,row,col,1); + + /* P=eye(A),D=A,S=0*P;index=1; */ + if(nor < eps*row*row){ + memcpy(out2,inp1,row*col*sizeof(double)); + deyea(out2,row,col); + memcpy(out3,inp1,row*col*sizeof(double)); + for(i=0;i<row;i++){ + for(j=0;j<row;j++){ + out1[i*row+j] = 0; + } + } + index = 1; + } + + /* rcond(A) */ + double *rcon; + rcon = rcond(inp1,row); + if(rcon > tol){ + dinverma(inp1,out1,row); + for(i=0;i<row*col;i++){ + out2[i]=0; + out3[i]=0; + } + index = 0; + return index; + } + index = 1; +} diff --git a/src/c/linearAlgebra/qr/dqra.c b/src/c/linearAlgebra/qr/dqra.c new file mode 100644 index 0000000..bae4bc2 --- /dev/null +++ b/src/c/linearAlgebra/qr/dqra.c @@ -0,0 +1,298 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +/* This C code is used to generate function for QR decomposition */ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "qr.h" +#include "lapack.h" +#include "string.h" +#include "matrixTranspose.h" + +/*For reference check Scilab source code & lapack library websites +Names of variable are almost same for convience. +*/ +/* +int min(int M,int N){ + if(M > N) return N; + return M; +} + +int max(int M,int N){ + if(M > N) return N; + return N; +}*/ + +/* External Function used of lapack library */ +extern double dgeqrf_(int *,int *,double *,int *,double *,double *,int *,int *); +extern double dlacpy_(char *,int *,int *,double *,int *,double *,int *); +extern double dgeqpf_(int *,int *,double *,int *,int *,double *,double *,int *); +extern double dorgqr_(int *,int *,int *,double *,int *,double *,double *,int *,int *); +extern void dlaset_(char *,int *,int *,double *,double *,double *,int *); + +/* function for finding qr */ +double dqra(int ninp,int nout,double *inp1,int M,int N,double tol,double *out1,double *out2,double *out3){ + int i,j; + char choice; + double alpha=0.0,beta=0.0; + int minMN = min(M,N); + + double *A; + A = (double *)malloc(M*N*sizeof(double)); + memcpy(A,inp1,M*N*sizeof(double)); + + if(M <= 0 || N <= 0){ + out1 = NULL; + out2 = NULL; + return 0; + } + /* doldqr */ + if(nout == 4){ /* [Q,R,rk,E]=qr(X [,tol]) */ + if(ninp == 1){ + tol = -1; + } + + int INFO,rk; + + int *JPVT; + JPVT = ( int *)malloc(N*sizeof(int)); + + double *TAU; + TAU = (double *)malloc(minMN*sizeof(double)); + + int LWORK = 3*N; + + double *WORK; + WORK = (double *)malloc(LWORK*sizeof(double)); + + for(i=1;i<=M;i++){ + JPVT[i-1]=0.0; + } + dgeqpf_(&M,&N,A,&M,JPVT,TAU,WORK,&INFO); + + choice = 'U'; + dlacpy_(&choice,&M,&N,A,&M,out2,&M); + + if(M > N){ + for(j=1;j<=N;j++){ + for(i=j+1;i<=M;i++){ + out2[i-1+(j-1)*M] = 0.0; + } + } + } + else{ + for(j=1;j<=M-1;j++){ + for(i=j+1;i<=M;i++){ + out2[i-1+(j-1)*M] = 0.0; + } + } + } + + if(M > N){ + choice = 'F'; + dlacpy_(&choice,&M,&N,A,&M,out1,&M); + for(j=N+1;j<=M;j++){ + for(i=1;i<=M;i++){ + out1[i-1+(j-1)*M] = 0.0; + } + } + } + else{ + choice = 'F'; + dlacpy_(&choice,&M,&M,A,&M,out1,&M); + } + + dorgqr_(&M,&M,&minMN,out1,&M,TAU,WORK,&LWORK,&INFO); + + choice = 'F'; + dlaset_(&choice,&N,&N,&alpha,&beta,out3,&N); + + for(j=1;j<=N;j++){ + i = JPVT[j-1]; + out3[i-1+(j-1)*N] = 1.0; + } + + double tt = abs(out2[0]); + + if(tol == -1){ + tol = (double)max(M,N)*pow(2,-52)*tt; + } + double ch; + //printf("%lf ",tol); + for(j=1;j<=minMN;j++){ + //printf("%e ",out2[(j-1)+(j-1)*M]); + if(out2[(j-1)+(j-1)*M] < 0){ + ch = -out2[(j-1)+(j-1)*M]; + } + else{ + ch = out2[(j-1)+(j-1)*M]; + } + if(ch > tol){ + rk = j; + } + else{ + break; + } + } + //printf("\n"); + return rk; + } + else if(ninp == 1){ + /* (intdgeqpf3) + [Q,R]=qr(A) + [Q,R,E]=qr(A) + */ + int LDA = M; + + double *TAU; + TAU = (double *)malloc(min(M,N)*sizeof(double)); + + int LWORK; + if(nout <= 2) + LWORK = N; + else + LWORK = 3*N; + + double *WORK; + WORK = (double *)malloc((LWORK+1)*sizeof(double)); + + int INFO; + + int *JPVT; + JPVT = (int *)malloc(N*sizeof(int)); + + if(nout <= 2){ + dgeqrf_(&M,&N,A,&M,TAU,WORK,&LWORK,&INFO); + } + else{ + for(i=0;i<N;i++){ + *(JPVT+i)=0.0; + } + dgeqpf_(&M,&N,A,&M,JPVT,TAU,WORK,&INFO); + } + + /* Copying code from A to R */ + choice = 'U'; + dlacpy_(&choice,&M,&N,A,&M,out2,&M); + /*for(i=0;i<M;i++){ + for(j=0;j<N-i;j++){ + out2[i+j*M] = A[i+j*M]; + } + }*/ + + if(M > N){ + for(j=1;j<=N;j++){ + for(i=j+1;i<=M;i++){ + out2[i-1+(j-1)*M] = 0.0; + } + } + } + else{ + for(j=1;j<=M-1;j++){ + for(i=j+1;i<=M;i++){ + out2[i-1+(j-1)*M] = 0.0; + } + } + } + /* lQ - out1 */ + if(M > N){ + choice = 'F'; + dlacpy_(&choice,&M,&N,A,&M,out1,&M); + /*for(i=0;i<M*N;i++){ + out1[i]=A[i]; + }*/ + for(j=N+1;j<=M;j++){ + for(i=1;i<=M;i++){ + out1[i+(j-1)*M] = 0.0; + } + } + } + else{ + choice = 'F'; + dlacpy_(&choice,&M,&M,A,&M,out1,&M); + /*for(i=0;i<M;i++){ + for(j=0;j<M;j++){ + out1 + } + }*/ + } + dorgqr_(&M,&M,&minMN,out1,&M,TAU,WORK,&LWORK,&INFO); + + if(nout > 2){ + choice = 'F'; + dlaset_(&choice,&N,&N,&alpha,&beta,out3,&N); + for(j=1;j<=N;j++){ + i = *(JPVT+j-1); + //printf("%d ",i-1+(j-1)*N); + *(out3+i-1+(j-1)*N) = 1.0; + } + //printf("\n"); + } + } + else{/* + [[Q,R]=qr(A,'e') + [Q,R,E]=qr(A,'e') ] */ + int *JPVT; + JPVT = (int *)malloc(N*sizeof(int)); + + double *TAU; + TAU = (double *)malloc(min(M,N)*sizeof(double)); + int LWORK; + if(nout <= 2){ + LWORK = N; + } + else{ + LWORK = 3*N; + } + + double *WORK; + WORK = (double *)malloc(LWORK*sizeof(double)); + + int INFO; + if(nout <= 2) + dgeqrf_(&M,&N,A,&M,TAU,WORK,&LWORK,&INFO); + else{ + for(i=1;i<=N;i++){ + JPVT[i-1]=0.0; + } + dgeqpf_(&M,&N,A,&M,JPVT,TAU,WORK,&INFO); + } + choice = 'U'; + + dlacpy_(&choice,&minMN,&N,A,&M,out2,&minMN); + + if(N >= 2){ + for(j=1;j<=N-1;j++){ + if(j+1 <= minMN){ + for(i=j+1;i<=minMN;i++){ + out2[i-1+(j-1)*minMN] = 0.0; + } + } + } + } + choice = 'F'; + dlacpy_(&choice,&M,&minMN,A,&M,out1,&M); + dorgqr_(&M,&minMN,&minMN,out1,&M,TAU,WORK,&LWORK,&INFO); + + if(nout > 2){ + choice = 'F'; + dlaset_(&choice,&N,&N,&alpha,&beta,out3,&N); + for(j=1;j<=N;j++){ + i = JPVT[j-1]; + out3[i-1+(j-1)*N] = 1.0; + } + } + } + return 0; +} diff --git a/src/c/linearAlgebra/rowcomp/drowcompa.c b/src/c/linearAlgebra/rowcomp/drowcompa.c new file mode 100644 index 0000000..3161a2d --- /dev/null +++ b/src/c/linearAlgebra/rowcomp/drowcompa.c @@ -0,0 +1,79 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +/* This function is used to find row compression, range */ + +#include "rowcomp.h" +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "svd.h" +#include "norm.h" +#include "eye.h" +#include "matrixTranspose.h" +#include "qr.h" + +/* All variable names, are in consideration of scilab documentation. for reference please check the scilab code.*/ + +double drowcompa(int ninp,double *A,int row,int col,char *flag,double tol,double *w){ + double rk; + double *U; + double *S; + double *V; + double *q,*r,*e; + if(row == 0 || col == 0){ + w = NULL; + return 0; + } + + double nA1 = dnorma(A,row,col,1); + if(nA1 < sqrt(pow(2,-52))/10){ + deyea(w,row,col); + return 0; + } + if(ninp == 1){ + flag = "svd"; + tol = sqrt(pow(2,-52))*nA1; + } + else if(ninp == 2){ + tol = sqrt(pow(2,-52))*nA1; + } + else{ + if(tol < 0){ /* if tolerance is negative */ + printf(" Wrong values for input argument #: Non-negative scalar expected"); + } + } + int M = row,N=col; + int minMN = min(M,N); + char check[3]="qr"; + //printf(" %s ",flag); + if(strcmp(check,flag) == 0){ + /* calling qr function*/ + //printf(" * "); + q = (double *)malloc(M*min(M,N)*sizeof(double)); + r = (double *)malloc(minMN*N*sizeof(double)); + e = (double *)malloc(N*N*sizeof(double)); + rk = dqra(2,4,A,M,N,tol,q,r,e); + memcpy(w,q,row*col*sizeof(double)); + dtransposea(q,row,row,w); + return rk; + } + else{ + /* svd function type */ + U = (double *)malloc(row*row*sizeof(double)); + S = (double *)malloc(row*col*sizeof(double)); + V = (double *)malloc(col*col*sizeof(double)); + rk = dsvda(tol,A,row,col,0,4,U,S,V); + dtransposea(U,row,row,w); + return rk; + } +} diff --git a/src/c/linearAlgebra/sqroot/dsqroota.c b/src/c/linearAlgebra/sqroot/dsqroota.c new file mode 100644 index 0000000..1ba9726 --- /dev/null +++ b/src/c/linearAlgebra/sqroot/dsqroota.c @@ -0,0 +1,130 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +/* Function - sqroot of scilab, W*W' hermitian factorization */ + +#include <stdio.h> +#include "stdlib.h" +#include "string.h" +#include <math.h> +#include "matrixTranspose.h" +#include "svd.h" +#include "matrixMultiplication.h" + +#define eps 2.22044604925e-16 + +/*It would be good, if you are doing conversoins for only valid inputs before + running the program, check all the conditions before hand. +*/ + +void dsqroota(double *inp,int row,int col, double *out){ + if(row != col){ + printf("Enter valid inputs only - matrix should be symetric\n"); + return; + } + int i,j; + double *U,*S,*V; + double *A,*B; + int rk; + + U = (double *)malloc((double)row*row*sizeof(double)); + S = (double *)malloc((double)Min(row,col)*Min(row,col)*sizeof(double)); + V = (double *)malloc((double)col*col*sizeof(double)); + A = (double *)malloc(rk*rk*sizeof(double)); + B = (double *)malloc(rk*row*sizeof(double)); + + double *Q1; + Q1 = (double *)malloc(row*col*sizeof(double)); + + dtransposea(inp,row,col,Q1); + + double *Q2; + Q2 = (double *)malloc(col*row*sizeof(double)); + + /* Q2 = (inp+inp1')/2; */ + for(i=0;i<row;i++){ + for(j=0;j<row;j++){ + Q2[i+j*row] = ((inp[i+j*row]+Q1[i+j*row])/2); + } + } + + /* norm(Q2-Q1,1) - finding the max value from sum of columns */ + double sum = 0; + double maxi=0; + for(i=0;i<row;i++){ + sum = 0; + for(j=0;j<col;j++) sum+=(Q2[i*row+j]-inp[i*row+j]); + if(maxi < sum){ + maxi = sum; + } + } + + /* if norm(Q1-Q,1) > 100*%eps then */ + if(maxi > 100*eps){ + printf("Warning: Wrong size for input argument and Symmetric expected\n"); + } + maxi = 0; + for(i=0;i<col;i++){ + sum=0; + for(j=0;j<row;j++) sum+=Q1[i*row+j]; + if(maxi < sum){ + maxi = sum; + } + } + + /*if norm(Q,1) < sqrt(%eps) then S=[];return;end*/ + + if(maxi < sqrt(eps)){ + out = NULL; + } + else{ + rk = dsvda(0,inp,row,col,0,4,U,S,V); + + /*Will be used in complex numbers*/ + //C = (double *)malloc(rk*row*sizeof(double)); + + /*for(i=0;i<row;i++){ + for(j=0;j<row;j++){ + printf("%lf ",S[i*row+j]); + } + printf("\n"); + }*/ + /*sqrt of S*/ + //printf("%d ",rk); + for(i=0;i<rk;i++){ + for(j=0;j<rk;j++){ + A[i*rk+j] = sqrt(S[i*row+j]); + //printf("%lf ",A[i*rk+j]); + } + } + for(i=0;i<col*rk;i++){ + B[i] = V[i]; + //printf("%lf ",B[i]); + } + //printf("\n"); + /*for(i=0;i<rk;i++){ + for(j=0;j<rk;j++){ + //A[i*rk+j] = sqrt(S[i*row+j]); + printf("%lf ",A[i*rk+j]); + } + printf("\n"); + }*/ + /*for(i=0;i<col;i++){ + for(j=0;j<rk;j++){ + //B[i*col+j] = VT[i*col+j]; + printf("%lf ",B[i*col+j]); + } + printf("\n"); + }*/ + dmulma(B,col,rk,A,rk,rk,out); + } +} diff --git a/src/c/linearAlgebra/sva/dsvaa.c b/src/c/linearAlgebra/sva/dsvaa.c index b7d07d8..691694e 100644 --- a/src/c/linearAlgebra/sva/dsvaa.c +++ b/src/c/linearAlgebra/sva/dsvaa.c @@ -20,6 +20,7 @@ #define eps 2.22044604925e-16 +/* Ref: Scilab source code */ void dsvaa(int ninp,double *in1,int row,int col,double in2,double *out1, \ double *out2,double *out3){ @@ -33,14 +34,14 @@ void dsvaa(int ninp,double *in1,int row,int col,double in2,double *out1, \ /* Calculation of svd of a given matrix */ double *U,*S,*V; - U = (double *)malloc((double)row*min(row,col)*sizeof(double)); - S = (double *)malloc((double)min(row,col)*min(row,col)*sizeof(double)); - V = (double *)malloc((double)col*min(row,col)*sizeof(double)); + U = (double *)malloc((double)row*Min(row,col)*sizeof(double)); + S = (double *)malloc((double)Min(row,col)*Min(row,col)*sizeof(double)); + V = (double *)malloc((double)col*Min(row,col)*sizeof(double)); dsvda(0,in1,M,N,1,3,U,S,V); if (ninp == 1){ /* [u,s,v] = sva(A) when input is only matrix */ - tol = max(row,col)*S[0]*eps; + tol = Max(row,col)*S[0]*eps; rk = 0; for(i=0;i<col;i++){ if(S[i+i*row] > tol){ @@ -52,7 +53,7 @@ void dsvaa(int ninp,double *in1,int row,int col,double in2,double *out1, \ tol = in2; if(tol > 1){ rk = tol; - if(rk > min(row,col)){ + if(rk > Min(row,col)){ printf("ERROR: Wrong value for input argument !"); out1 = NULL; out2 = NULL; @@ -70,21 +71,21 @@ void dsvaa(int ninp,double *in1,int row,int col,double in2,double *out1, \ } } arow = M; - acol = min(M,N); + acol = Min(M,N); /* Copying, the output in required format */ for(i=0;i<arow;i++){ for(j=0;j<rk;j++){ out1[i+j*row]=U[i+j*arow]; } } - arow = min(M,N); - for(i=0;i<rk;i++){ + arow = Min(M,N); + for(i=0;i<rk;i++){ /* Copying, the output in required format */ for(j=0;j<rk;j++){ out2[i+j*(int)rk] = S[i+j*arow]; } } arow = N; - acol = min(M,N); - for(i=0;i<arow;i++){ + acol = Min(M,N); + for(i=0;i<arow;i++){ /* Copying, the output in required format */ for(j=0;j<rk;j++){ out3[i+j*arow] = V[i+j*arow]; } diff --git a/src/c/linearAlgebra/svd/.1.c.swp b/src/c/linearAlgebra/svd/.1.c.swp Binary files differnew file mode 100644 index 0000000..81d9e9c --- /dev/null +++ b/src/c/linearAlgebra/svd/.1.c.swp diff --git a/src/c/linearAlgebra/svd/zsvda.c b/src/c/linearAlgebra/svd/zsvda.c index 0d36022..c75cc50 100644 --- a/src/c/linearAlgebra/svd/zsvda.c +++ b/src/c/linearAlgebra/svd/zsvda.c @@ -19,6 +19,7 @@ #include "matrixTranspose.h" #include "conj.h" +/* Lapack functions used . */ extern doubleComplex zgesvd_( char* , char* , int* , int* ,doubleComplex *,\ int* , double* ,doubleComplex* , int* ,doubleComplex* , int* ,\ doubleComplex* , int* , double* , int* ); @@ -113,7 +114,16 @@ void zsvda(doubleComplex *in1,int row,int col,int in2,int nout, doubleComplex *o out3[i+j*N] = zconjs(VT[j+i*N]); out3[j+i*N] = zconjs(VT[i+j*N]); } - } + } + /* output from zgesvd is copied to out2 variables in required format*/ + for(j=0;j<M;j++){ + for(k=0;k<N;k++){ + if(j == k) + out2[j*(Min(M,N))+k] = DoubleComplex(S[j],0); + else + out2[j*(Min(M,N))+k] = DoubleComplex(0,0); + } + } //ztransposea(VT,LDVT,Min(M,N),out3); /*for(i=0;i<N;i++){ for(j=0;j<N;j++){ @@ -124,7 +134,7 @@ void zsvda(doubleComplex *in1,int row,int col,int in2,int nout, doubleComplex *o //free(U); //free(VT); } - else{ + else{ /*svd(x,'e')*/ LDA = M; LDU = M; if(M > N){ @@ -156,18 +166,18 @@ void zsvda(doubleComplex *in1,int row,int col,int in2,int nout, doubleComplex *o for(j=0;j<N;j++){ out3[j+i*N] = zconjs(VT[i+j*Min(M,N)]); } - } + } + /* output from zgesvd is copied to out2 variables in required format*/ + for(j=0;j<Min(M,N);j++){ + for(k=0;k<Min(M,N);k++){ + if(j == k) + out2[j*(Min(M,N))+k] = DoubleComplex(S[j],0); + else + out2[j*(Min(M,N))+k] = DoubleComplex(0,0); + } + } //free(U); //free(VT); } - /* output from zgesvd is copied to out2 variables in required format*/ - for(j=0;j<Min(M,N);j++){ - for(k=0;k<Min(M,N);k++){ - if(j == k) - out2[j*(Min(M,N))+k] = DoubleComplex(S[j],0); - else - out2[j*(Min(M,N))+k] = DoubleComplex(0,0); - } - } } } diff --git a/src/c/matrixOperations/cross/ccrossa.c b/src/c/matrixOperations/cross/ccrossa.c new file mode 100644 index 0000000..5f74bb3 --- /dev/null +++ b/src/c/matrixOperations/cross/ccrossa.c @@ -0,0 +1,37 @@ +#include <stdio.h> +#include <stdlib.h> +#include <cross.h> +#include "floatComplex.h" +#include "stdlib.h" +#include "string.h" +#include "cat.h" + +void ccrossa (floatComplex* inp1, int size1_r, int size1_c, floatComplex* inp2, int size2_r, int size2_c ,floatComplex* oup) +{ + int i,j; + + if (size1_c == 3 && size1_r == 1) // Calculating the cross product for a 1X3 Matrix + { + oup[0] = inp1[1]*inp2[2] - inp1[2]*inp2[1]; + oup[1] = inp1[2]*inp2[0] - inp1[0]*inp2[2]; + oup[2] = inp1[0]*inp2[1] - inp1[1]*inp2[0]; + printf("%lf ", oup[0]); + printf("%lf ", oup[1]); + printf("%lf \n", oup[2]); + } + else // Calculating the cross product for a 3XN Matrix + { + for(i = 0; i < size1_r; i++) + { + for(j = 0; j < size1_c; j = j+3) + { + oup[j+(i*size1_r)] = inp1[(j+1)+(i*size1_r)] * inp2[(j+2)+(i*size1_r)] - inp1[(j+2)+(i*size1_r)] * inp2[(j+1)+(i*size1_r)]; + oup[(j+1)+(i*size1_r)] = inp1[(j+2)+(i*size1_r)] * inp2[(j+0)+(i*size1_r)] - inp1[(j+0)+(i*size1_r)] * inp2[(j+2)+(i*size1_r)]; + oup[(j+2)+(i*size1_r)] = inp1[(j+0)+(i*size1_r)] * inp2[(j+1)+(i*size1_r)] - inp1[(j+1)+(i*size1_r)] * inp2[(j+0)+(i*size1_r)]; + + } + } + + } +} + diff --git a/src/c/matrixOperations/cross/dcrossa.c b/src/c/matrixOperations/cross/dcrossa.c new file mode 100644 index 0000000..203ec24 --- /dev/null +++ b/src/c/matrixOperations/cross/dcrossa.c @@ -0,0 +1,33 @@ +#include <stdio.h> +#include <stdlib.h> +#include <cross.h> + +void dcrossa (double* inp1, int size1_r, int size1_c, double* inp2, int size2_r, int size2_c ,double* oup) +{ + int i,j; + + if (size1_c == 3 && size1_r == 1) // Calculating the cross product for a 1X3 Matrix + { + oup[0] = inp1[1]*inp2[2] - inp1[2]*inp2[1]; + oup[1] = inp1[2]*inp2[0] - inp1[0]*inp2[2]; + oup[2] = inp1[0]*inp2[1] - inp1[1]*inp2[0]; + printf("%lf ", oup[0]); + printf("%lf ", oup[1]); + printf("%lf \n", oup[2]); + } + else // Calculating the cross product for a 3XN Matrix + { + for(i = 0; i < size1_r; i++) + { + for(j = 0; j < size1_c; j = j+3) + { + oup[j+(i*size1_r)] = inp1[(j+1)+(i*size1_r)] * inp2[(j+2)+(i*size1_r)] - inp1[(j+2)+(i*size1_r)] * inp2[(j+1)+(i*size1_r)]; + oup[(j+1)+(i*size1_r)] = inp1[(j+2)+(i*size1_r)] * inp2[(j+0)+(i*size1_r)] - inp1[(j+0)+(i*size1_r)] * inp2[(j+2)+(i*size1_r)]; + oup[(j+2)+(i*size1_r)] = inp1[(j+0)+(i*size1_r)] * inp2[(j+1)+(i*size1_r)] - inp1[(j+1)+(i*size1_r)] * inp2[(j+0)+(i*size1_r)]; + + } + } + + } +} + diff --git a/src/c/matrixOperations/cross/i16crossa.c b/src/c/matrixOperations/cross/i16crossa.c new file mode 100644 index 0000000..91cdb7f --- /dev/null +++ b/src/c/matrixOperations/cross/i16crossa.c @@ -0,0 +1,34 @@ +#include <stdio.h> +#include <stdlib.h> +#include <cross.h> +#include "int16.h" + +void i16crossa (int16* inp1, int size1_r, int size1_c, int16* inp2, int size2_r, int size2_c ,int16* oup) +{ + int i,j; + + if (size1_c == 3 && size1_r == 1) // Calculating the cross product for a 1X3 Matrix + { + oup[0] = inp1[1]*inp2[2] - inp1[2]*inp2[1]; + oup[1] = inp1[2]*inp2[0] - inp1[0]*inp2[2]; + oup[2] = inp1[0]*inp2[1] - inp1[1]*inp2[0]; + printf("%lf ", oup[0]); + printf("%lf ", oup[1]); + printf("%lf \n", oup[2]); + } + else // Calculating the cross product for a 3XN Matrix + { + for(i = 0; i < size1_r; i++) + { + for(j = 0; j < size1_c; j = j+3) + { + oup[j+(i*size1_r)] = inp1[(j+1)+(i*size1_r)] * inp2[(j+2)+(i*size1_r)] - inp1[(j+2)+(i*size1_r)] * inp2[(j+1)+(i*size1_r)]; + oup[(j+1)+(i*size1_r)] = inp1[(j+2)+(i*size1_r)] * inp2[(j+0)+(i*size1_r)] - inp1[(j+0)+(i*size1_r)] * inp2[(j+2)+(i*size1_r)]; + oup[(j+2)+(i*size1_r)] = inp1[(j+0)+(i*size1_r)] * inp2[(j+1)+(i*size1_r)] - inp1[(j+1)+(i*size1_r)] * inp2[(j+0)+(i*size1_r)]; + + } + } + + } +} + diff --git a/src/c/matrixOperations/cross/i8crossa.c b/src/c/matrixOperations/cross/i8crossa.c new file mode 100644 index 0000000..adfbd53 --- /dev/null +++ b/src/c/matrixOperations/cross/i8crossa.c @@ -0,0 +1,34 @@ +#include <stdio.h> +#include <stdlib.h> +#include <cross.h> +#include "int8.h" + +void i8crossa (int8* inp1, int size1_r, int size1_c, int8* inp2, int size2_r, int size2_c ,int8* oup) +{ + int i,j; + + if (size1_c == 3 && size1_r == 1) // Calculating the cross product for a 1X3 Matrix + { + oup[0] = inp1[1]*inp2[2] - inp1[2]*inp2[1]; + oup[1] = inp1[2]*inp2[0] - inp1[0]*inp2[2]; + oup[2] = inp1[0]*inp2[1] - inp1[1]*inp2[0]; + printf("%lf ", oup[0]); + printf("%lf ", oup[1]); + printf("%lf \n", oup[2]); + } + else // Calculating the cross product for a 3XN Matrix + { + for(i = 0; i < size1_r; i++) + { + for(j = 0; j < size1_c; j = j+3) + { + oup[j+(i*size1_r)] = inp1[(j+1)+(i*size1_r)] * inp2[(j+2)+(i*size1_r)] - inp1[(j+2)+(i*size1_r)] * inp2[(j+1)+(i*size1_r)]; + oup[(j+1)+(i*size1_r)] = inp1[(j+2)+(i*size1_r)] * inp2[(j+0)+(i*size1_r)] - inp1[(j+0)+(i*size1_r)] * inp2[(j+2)+(i*size1_r)]; + oup[(j+2)+(i*size1_r)] = inp1[(j+0)+(i*size1_r)] * inp2[(j+1)+(i*size1_r)] - inp1[(j+1)+(i*size1_r)] * inp2[(j+0)+(i*size1_r)]; + + } + } + + } +} + diff --git a/src/c/matrixOperations/cross/scrossa.c b/src/c/matrixOperations/cross/scrossa.c new file mode 100644 index 0000000..414b85a --- /dev/null +++ b/src/c/matrixOperations/cross/scrossa.c @@ -0,0 +1,33 @@ +#include <stdio.h> +#include <stdlib.h> +#include <cross.h> + +void scrossa (float* inp1, int size1_r, int size1_c, float* inp2, int size2_r, int size2_c ,float* oup) +{ + int i,j; + + if (size1_c == 3 && size1_r == 1) // Calculating the cross product for a 1X3 Matrix + { + oup[0] = inp1[1]*inp2[2] - inp1[2]*inp2[1]; + oup[1] = inp1[2]*inp2[0] - inp1[0]*inp2[2]; + oup[2] = inp1[0]*inp2[1] - inp1[1]*inp2[0]; + printf("%lf ", oup[0]); + printf("%lf ", oup[1]); + printf("%lf \n", oup[2]); + } + else // Calculating the cross product for a 3XN Matrix + { + for(i = 0; i < size1_r; i++) + { + for(j = 0; j < size1_c; j = j+3) + { + oup[j+(i*size1_r)] = inp1[(j+1)+(i*size1_r)] * inp2[(j+2)+(i*size1_r)] - inp1[(j+2)+(i*size1_r)] * inp2[(j+1)+(i*size1_r)]; + oup[(j+1)+(i*size1_r)] = inp1[(j+2)+(i*size1_r)] * inp2[(j+0)+(i*size1_r)] - inp1[(j+0)+(i*size1_r)] * inp2[(j+2)+(i*size1_r)]; + oup[(j+2)+(i*size1_r)] = inp1[(j+0)+(i*size1_r)] * inp2[(j+1)+(i*size1_r)] - inp1[(j+1)+(i*size1_r)] * inp2[(j+0)+(i*size1_r)]; + + } + } + + } +} + diff --git a/src/c/matrixOperations/cross/u16crossa.c b/src/c/matrixOperations/cross/u16crossa.c new file mode 100644 index 0000000..e0a32bc --- /dev/null +++ b/src/c/matrixOperations/cross/u16crossa.c @@ -0,0 +1,34 @@ +#include <stdio.h> +#include <stdlib.h> +#include <cross.h> +#include "uint16.h" + +void u16crossa (uint16* inp1, int size1_r, int size1_c, uint16* inp2, int size2_r, int size2_c ,uint16* oup) +{ + int i,j; + + if (size1_c == 3 && size1_r == 1) // Calculating the cross product for a 1X3 Matrix + { + oup[0] = inp1[1]*inp2[2] - inp1[2]*inp2[1]; + oup[1] = inp1[2]*inp2[0] - inp1[0]*inp2[2]; + oup[2] = inp1[0]*inp2[1] - inp1[1]*inp2[0]; + printf("%lf ", oup[0]); + printf("%lf ", oup[1]); + printf("%lf \n", oup[2]); + } + else // Calculating the cross product for a 3XN Matrix + { + for(i = 0; i < size1_r; i++) + { + for(j = 0; j < size1_c; j = j+3) + { + oup[j+(i*size1_r)] = inp1[(j+1)+(i*size1_r)] * inp2[(j+2)+(i*size1_r)] - inp1[(j+2)+(i*size1_r)] * inp2[(j+1)+(i*size1_r)]; + oup[(j+1)+(i*size1_r)] = inp1[(j+2)+(i*size1_r)] * inp2[(j+0)+(i*size1_r)] - inp1[(j+0)+(i*size1_r)] * inp2[(j+2)+(i*size1_r)]; + oup[(j+2)+(i*size1_r)] = inp1[(j+0)+(i*size1_r)] * inp2[(j+1)+(i*size1_r)] - inp1[(j+1)+(i*size1_r)] * inp2[(j+0)+(i*size1_r)]; + + } + } + + } +} + diff --git a/src/c/matrixOperations/cross/u8crossa.c b/src/c/matrixOperations/cross/u8crossa.c new file mode 100644 index 0000000..7a8b857 --- /dev/null +++ b/src/c/matrixOperations/cross/u8crossa.c @@ -0,0 +1,34 @@ +#include <stdio.h> +#include <stdlib.h> +#include <cross.h> +#include "uint8.h" + +void u8crossa (uint8* inp1, int size1_r, int size1_c, uint8* inp2, int size2_r, int size2_c ,uint8* oup) +{ + int i,j; + + if (size1_c == 3 && size1_r == 1) // Calculating the cross product for a 1X3 Matrix + { + oup[0] = inp1[1]*inp2[2] - inp1[2]*inp2[1]; + oup[1] = inp1[2]*inp2[0] - inp1[0]*inp2[2]; + oup[2] = inp1[0]*inp2[1] - inp1[1]*inp2[0]; + printf("%lf ", oup[0]); + printf("%lf ", oup[1]); + printf("%lf \n", oup[2]); + } + else // Calculating the cross product for a 3XN Matrix + { + for(i = 0; i < size1_r; i++) + { + for(j = 0; j < size1_c; j = j+3) + { + oup[j+(i*size1_r)] = inp1[(j+1)+(i*size1_r)] * inp2[(j+2)+(i*size1_r)] - inp1[(j+2)+(i*size1_r)] * inp2[(j+1)+(i*size1_r)]; + oup[(j+1)+(i*size1_r)] = inp1[(j+2)+(i*size1_r)] * inp2[(j+0)+(i*size1_r)] - inp1[(j+0)+(i*size1_r)] * inp2[(j+2)+(i*size1_r)]; + oup[(j+2)+(i*size1_r)] = inp1[(j+0)+(i*size1_r)] * inp2[(j+1)+(i*size1_r)] - inp1[(j+1)+(i*size1_r)] * inp2[(j+0)+(i*size1_r)]; + + } + } + + } +} + diff --git a/src/c/matrixOperations/cross/zcrossa.c b/src/c/matrixOperations/cross/zcrossa.c new file mode 100644 index 0000000..85a1960 --- /dev/null +++ b/src/c/matrixOperations/cross/zcrossa.c @@ -0,0 +1,37 @@ +#include <stdio.h> +#include <stdlib.h> +#include <cross.h> +#include "doubleComplex.h" +#include "stdlib.h" +#include "string.h" +#include "cat.h" + +void zcrossa (doubleComplex* inp1, int size1_r, int size1_c, doubleComplex* inp2, int size2_r, int size2_c ,doubleComplex* oup) +{ + int i,j; + + if (size1_c == 3 && size1_r == 1) // Calculating the cross product for a 1X3 Matrix + { + oup[0] = inp1[1]*inp2[2] - inp1[2]*inp2[1]; + oup[1] = inp1[2]*inp2[0] - inp1[0]*inp2[2]; + oup[2] = inp1[0]*inp2[1] - inp1[1]*inp2[0]; + printf("%lf ", oup[0]); + printf("%lf ", oup[1]); + printf("%lf \n", oup[2]); + } + else // Calculating the cross product for a 3XN Matrix + { + for(i = 0; i < size1_r; i++) + { + for(j = 0; j < size1_c; j = j+3) + { + oup[j+(i*size1_r)] = inp1[(j+1)+(i*size1_r)] * inp2[(j+2)+(i*size1_r)] - inp1[(j+2)+(i*size1_r)] * inp2[(j+1)+(i*size1_r)]; + oup[(j+1)+(i*size1_r)] = inp1[(j+2)+(i*size1_r)] * inp2[(j+0)+(i*size1_r)] - inp1[(j+0)+(i*size1_r)] * inp2[(j+2)+(i*size1_r)]; + oup[(j+2)+(i*size1_r)] = inp1[(j+0)+(i*size1_r)] * inp2[(j+1)+(i*size1_r)] - inp1[(j+1)+(i*size1_r)] * inp2[(j+0)+(i*size1_r)]; + + } + } + + } +} + diff --git a/src/c/matrixOperations/includes/cross.h b/src/c/matrixOperations/includes/cross.h new file mode 100644 index 0000000..0abd001 --- /dev/null +++ b/src/c/matrixOperations/includes/cross.h @@ -0,0 +1,37 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __CROSS_H__ +#define __CROSS_H__ +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dcrossa (double* inp1, int size1_r, int size1_c, double* inp2, int size2_r, int size2_c ,double* oup); +void zcrossa (doubleComplex* inp1, int size1_r, int size1_c, doubleComplex* inp2, int size2_r, int size2_c ,doubleComplex* oup); +void ccrossa (floatComplex* inp1, int size1_r, int size1_c, floatComplex* inp2, int size2_r, int size2_c ,floatComplex* oup); +void scrossa (float* inp1, int size1_r, int size1_c, float* inp2, int size2_r, int size2_c ,float* oup); +void u8crossa (uint8* inp1, int size1_r, int size1_c, uint8* inp2, int size2_r, int size2_c ,uint8* oup); +void u16crossa (uint16* inp1, int size1_r, int size1_c, uint16* inp2, int size2_r, int size2_c ,uint16* oup); +void i8crossa (int8* inp1, int size1_r, int size1_c, int8* inp2, int size2_r, int size2_c ,int8* oup); +void i16crossa (int16* inp1, int size1_r, int size1_c, int16* inp2, int size2_r, int size2_c ,int16* oup); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__CROSS_H__*/ diff --git a/src/c/matrixOperations/includes/matrix.h b/src/c/matrixOperations/includes/matrix.h new file mode 100644 index 0000000..582fd22 --- /dev/null +++ b/src/c/matrixOperations/includes/matrix.h @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#ifndef __MATRIX_H__ +#define __MATRIX_H__ + +#include "types.h" +#include "doubleComplex.h" +#include "uint16.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +void dmatrixa(double* , int , int , int , int , double*); +void smatrixa( float* , int , int , int , int , float*); +void u16matrixa(uint16 *, int , int , int , int ,uint16 *out); +void zmatrixa(doubleComplex *, int , int , int , int ,doubleComplex *); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__MATRIX_H__*/ diff --git a/src/c/matrixOperations/includes/nnz.h b/src/c/matrixOperations/includes/nnz.h new file mode 100644 index 0000000..c7d2d49 --- /dev/null +++ b/src/c/matrixOperations/includes/nnz.h @@ -0,0 +1,37 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#ifndef __NNZ_H__ +#define __NNZ_H__ + +#include "types.h" +#include "doubleComplex.h" +#include "uint16.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint16 dnnza(double* , int , int); +uint16 dnnzs(double); +uint16 snnza( float* , int , int); +uint16 snnzs( float); +uint16 znnza(doubleComplex *, int , int); +uint16 znnzs(doubleComplex); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__NNZ_H__*/ diff --git a/src/c/matrixOperations/includes/norm.h b/src/c/matrixOperations/includes/norm.h index dc9d351..4fe3872 100644 --- a/src/c/matrixOperations/includes/norm.h +++ b/src/c/matrixOperations/includes/norm.h @@ -5,7 +5,7 @@ you should have received as part of this distribution. The terms are also available at http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - Author: Siddhesh Wani + Author: Sandeep Gupta Organization: FOSSEE, IIT Bombay Email: toolbox@scilab.in */ diff --git a/src/c/matrixOperations/includes/spec.h b/src/c/matrixOperations/includes/spec.h deleted file mode 100644 index b7b7d35..0000000 --- a/src/c/matrixOperations/includes/spec.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ - - -#ifndef __SPEC_H__ -#define __SPEC_H__ - -#include "dynlib_matrixoperations.h" -#include "doubleComplex.h" -#include "floatComplex.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* spec gives only the eigenvalues - If you want the eigenvalues and the eigenvectors, use spec2 */ - -/* spec */ -#define sspecs(in) in -#define dspecs(in) in -#define cspecs(in) in -#define zspecs(in) in - -EXTERN_MATOPS void sspeca(float* in, int rows, float* out); -EXTERN_MATOPS void dspeca(double* in, int rows, double* out); -EXTERN_MATOPS void cspeca(floatComplex* in, int rows, floatComplex* out); -EXTERN_MATOPS void zspeca(doubleComplex* in, int rows,doubleComplex* out); - - - -/* spec2 */ -#define sspec2s(in,out) sspecs(1);*out=in; -#define dspec2s(in,out) dspecs(1);*out=in; -#define cspec2s(in,out) cspecs(FloatComplex(1,0));*out=FloatComplex(creals(in),cimags(in)); -#define zspec2s(in,out) zspecs(DoubleComplex(1,0));*out=DoubleComplex(zreals(in),zimags(in)); - -EXTERN_MATOPS void sspec2a(float* in, int rows, float* eigenvalues,float* eigenvectors); -EXTERN_MATOPS void dspec2a(double* in, int rows, double* eigenvalues,double* eigenvectors); -EXTERN_MATOPS void cspec2a(floatComplex* in, int rows, floatComplex* eigenvalues,floatComplex* eigenvectors); -EXTERN_MATOPS void zspec2a(doubleComplex* in, int rows,doubleComplex* eigenvalues,doubleComplex* eigenvectors); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* __SPEC_H__ */ diff --git a/src/c/matrixOperations/includes/toeplitz.h b/src/c/matrixOperations/includes/toeplitz.h new file mode 100644 index 0000000..7384b43 --- /dev/null +++ b/src/c/matrixOperations/includes/toeplitz.h @@ -0,0 +1,37 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __TOEPLITZ_H__ +#define __TOEPLITZ_H__ +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dtoeplitza(double* inp1,int size1,double* inp2,int size2,double* oup); +void u8toeplitza(uint8* inp1,int size1,uint8* inp2,int size2,uint8* oup); +void u16toeplitza(uint16* inp1,int size1,uint16* inp2,int size2,uint16* oup); +void ztoeplitza(doubleComplex* inp1,int size1,doubleComplex* inp2,int size2,doubleComplex* oup); +void gtoeplitza(char* inp1,int size1,char* inp2,int size2,char* oup); +void stoeplitza(float* inp1,int size1,float* inp2,int size2,float* oup); +void ctoeplitza(floatComplex* inp1,int size1,floatComplex* inp2,int size2,floatComplex* oup); +void i8toeplitza(int8* inp1,int size1,int8* inp2,int size2,int8* oup); +void i16toeplitza(int16* inp1,int size1,int16* inp2,int size2,int16* oup); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__TOEPLITZ_H__*/ diff --git a/src/c/matrixOperations/interfaces/int_cross.h b/src/c/matrixOperations/interfaces/int_cross.h new file mode 100644 index 0000000..8f4e782 --- /dev/null +++ b/src/c/matrixOperations/interfaces/int_cross.h @@ -0,0 +1,35 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __INT_CROSS_H__ +#define __INT_CROSS_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define d2d2crossd2(in1,size1,in2,size2,out) dcrossa(in1,size1[0],size1[1],in2,size2[0],size2[1],out) +#define z2z2crossz2(in1,size1,in2,size2,out) zcrossa(in1,size1[0],size1[1],in2,size2[0],size2[1],out) +#define c2c2crossc2(in1,size1,in2,size2,out) ccrossa(in1,size1[0],size1[1],in2,size2[0],size2[1],out) +#define s2s2crosss2(in1,size1,in2,size2,out) scrossa(in1,size1[0],size1[1],in2,size2[0],size2[1],out) +#define u82u82crossu82(in1,size1,in2,size2,out) u8crossa(in1,size1[0],size1[1],in2,size2[0],size2[1],out) +#define i82i82crossi82(in1,size1,in2,size2,out) i8crossa(in1,size1[0],size1[1],in2,size2[0],size2[1],out) +#define u162u162crossu162(in1,size1,in2,size2,out) u16crossa(in1,size1[0],size1[1],in2,size2[0],size2[1],out) +#define i162i162crossi162(in1,size1,in2,size2,out) i16crossa(in1,size1[0],size1[1],in2,size2[0],size2[1],out) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_CROSS_H__*/ diff --git a/src/c/matrixOperations/interfaces/int_matrix.h b/src/c/matrixOperations/interfaces/int_matrix.h new file mode 100644 index 0000000..5935f4a --- /dev/null +++ b/src/c/matrixOperations/interfaces/int_matrix.h @@ -0,0 +1,49 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __INT_MATRIX_H__ +#define __INT_MATRIX_H__ + + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2d0d0matrixd2(in1, size, in2, in3, out ) dmatrixa(in1, size[0], size[1], in2, in3, out) +#define d2s0s0matrixd2(in1, size, in2, in3, out ) dmatrixa(in1, size[0], size[1], in2, in3, out) +//#define d2u160u160matrixd2(in1, size, in2, in3, out ) dmatrixa(in1, size[0], size[1], in2, in3, out) +//#define d2u80u80matrixd2(in1, size, in2, in3, out ) dmatrixa(in1, size[0], size[1], in2, in3, out) + +#define s2d0d0matrixs2(in1, size, in2, in3, out ) smatrixa(in1, size[0], size[1], in2, in3, out) +#define s2s0s0matrixs2(in1, size, in2, in3, out ) smatrixa(in1, size[0], size[1], in2, in3, out) +//#define s2u160u160matrixs2(in1, size, in2, in3, out ) smatrixa(in1, size[0], size[1], in2, in3, out) +//#define s2u80u80matrixs2(in1, size, in2, in3, out ) smatrixa(in1, size[0], size[1], in2, in3, out) + +#define u162d0d0matrixu162(in1, size, in2, in3, out ) u16matrixa(in1, size[0], size[1], in2, in3, out) +#define u162s0s0matrixu162(in1, size, in2, in3, out ) u16matrixa(in1, size[0], size[1], in2, in3, out) +//#define s2u160u160matrixs2(in1, size, in2, in3, out ) smatrixa(in1, size[0], size[1], in2, in3, out) +//#define s2u80u80matrixs2(in1, size, in2, in3, out ) smatrixa(in1, size[0], size[1], in2, in3, out) + +#define z2d0d0matrixz2(in1, size, in2, in3, out ) zmatrixa(in1, size[0], size[1], in2, in3, out) +#define z2s0s0matrixz2(in1, size, in2, in3, out ) zmatrixa(in1, size[0], size[1], in2, in3, out) +//#define s2u160u160matrixs2(in1, size, in2, in3, out ) smatrixa(in1, size[0], size[1], in2, in3, out) +//#define s2u80u80matrixs2(in1, size, in2, in3, out ) smatrixa(in1, size[0], size[1], in2, in3, out) + + + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_MATRIX_H__*/ diff --git a/src/c/matrixOperations/interfaces/int_nnz.h b/src/c/matrixOperations/interfaces/int_nnz.h new file mode 100644 index 0000000..0ef3953 --- /dev/null +++ b/src/c/matrixOperations/interfaces/int_nnz.h @@ -0,0 +1,35 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __INT_NNZ_H__ +#define __INT_NNZ_H__ + + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2nnzu160(in1, size) dnnza(in1, size[0], size[1]) +#define d0nnzu160(in) dnnzs(in) + +#define s2nnzu160(in1, size) snnza(in1, size[0], size[1]) +#define s0nnzu160(in) snnzs(in) + +#define z2nnzu160(in1, size) znnza(in1, size[0], size[1]) +#define z0nnzu160(in) znnzs(in) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_NNZ_H__*/ diff --git a/src/c/matrixOperations/interfaces/int_spec.h b/src/c/matrixOperations/interfaces/int_spec.h deleted file mode 100644 index 77ab55e..0000000 --- a/src/c/matrixOperations/interfaces/int_spec.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ - -/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ - -#ifndef __INT_SPEC_H__ -#define __INT_SPEC_H__ - -/* Only eigenvalues */ - -#define s0specc0(in) FloatComplex (sspecs(in) , 0) - -#define d0specz0(in) DoubleComplex ( dspecs(in) , 0) - -#define c0specc0(in) cspecs(in) - -#define z0specz0(in) zspecs(in) - -#define s2specc2(in,size,out) {float* ZEROS;\ - ZEROS=malloc((uint)(size[0]*size[0]*sizeof(float)));\ - szerosa(ZEROS,size[0],size[0]);\ - cspeca(FloatComplexMatrix(in,ZEROS,size[0]*size[0]), size[0], out);\ - } - -#define d2specz2(in,size,out) {double* ZEROS;\ - ZEROS=malloc((uint)(size[0]*size[0]*sizeof(double)));\ - dzerosa(ZEROS,size[0],size[0]);\ - zspeca(DoubleComplexMatrix(in,ZEROS,size[0]*size[0]), size[0] , out);\ - } - -#define c2specc2(in,size,out) cspeca(in, size[0], out) - -#define z2specz2(in,size,out) zspeca(in, size[0], out) - -/* Eigenvalues and eigenvectors */ - -#define s0specc0c0(in,out) cspec2s(FloatComplex( in,0) ,out) - -#define d0specz0z0(in,out) zspec2s(DoubleComplex(in,0) ,out) - -#define c0specc0c0(in,out) cspec2s(in,out) - -#define z0specz0z0(in,out) zspec2s(in,out) - -#define s2specc2c2(in,size,out1,out2) {float* ZEROS;\ - ZEROS=malloc((uint)(size[0]*size[0]*sizeof(float)));\ - szerosa(ZEROS,size[0],size[0]);\ - cspec2a(FloatComplexMatrix(in,ZEROS,size[0]*size[0]), size[0] , out1 , out2 );\ - } - -#define d2specz2z2(in,size,out1,out2) {double* ZEROS;\ - ZEROS=malloc((uint)(size[0]*size[0]*sizeof(double)));\ - dzerosa(ZEROS,size[0],size[0]);\ - zspec2a(DoubleComplexMatrix(in,ZEROS,size[0]*size[0]), size[0] , out1 , out2 );\ - } - - -#define c2specc2c2(in,size,out1,out2) cspec2a(in, size[0], out2, out1) - -#define z2specz2z2(in,size,out1,out2) zspec2a(in, size[0], out2, out1) - -#endif /* !__INT_SPEC_H__ */ diff --git a/src/c/matrixOperations/interfaces/int_toeplitz.h b/src/c/matrixOperations/interfaces/int_toeplitz.h new file mode 100644 index 0000000..b602e9a --- /dev/null +++ b/src/c/matrixOperations/interfaces/int_toeplitz.h @@ -0,0 +1,50 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __INT_TOEPLITZ_H__ +#define __INT_TOEPLITZ_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2d2toeplitzd2(in1,size1,in2,size2,out) dtoeplitza(in1,size1[1],in2,size2[1],out) +#define d2toeplitzd2(in1,size1,out) dtoeplitza(in1,size1[1],in1,size1[1],out) + +#define u82u82toeplitzu82(in1,size1,in2,size2,out) u8toeplitza(in1,size1[1],in2,size2[1],out) +#define u82toeplitzu82(in1,size1,out) u8toeplitza(in1,size1[1],in1,size1[1],out) + +#define u162u162toeplitzu162(in1,size1,in2,size2,out) u16toeplitza(in1,size1[1],in2,size2[1],out) +#define u162toeplitzu162(in1,size1,out) u16toeplitza(in1,size1[1],in1,size1[1],out) + +#define g2g2toeplitzg2(in1,size1,in2,size2,out) gtoeplitza(in1,size1[1],in2,size2[1],out) +#define g2toeplitzg2(in1,size1,out) gtoeplitza(in1,size1[1],in1,size1[1],out) + +#define z2z2toeplitzz2(in1,size1,in2,size2,out) ztoeplitza(in1,size1[1],in2,size2[1],out) +#define z2toeplitzz2(in1,size1,out) ztoeplitza(in1,size1[1],in1,size1[1],out) + +#define s2s2toeplitzs2(in1,size1,in2,size2,out) stoeplitza(in1,size1[1],in2,size2[1],out) +#define s2toeplitzs2(in1,size1,out) stoeplitza(in1,size1[1],in1,size1[1],out) + +#define c2c2toeplitzc2(in1,size1,in2,size2,out) ctoeplitza(in1,size1[1],in2,size2[1],out) +#define c2toeplitzc2(in1,size1,out) ctoeplitza(in1,size1[1],in1,size1[1],out) + +#define i82i82toeplitzi82(in1,size1,in2,size2,out) i8toeplitza(in1,size1[1],in2,size2[1],out) +#define i82toeplitzi82(in1,size1,out) i8toeplitza(in1,size1[1],in1,size1[1],out) + +#define i162i162toeplitzi162(in1,size1,in2,size2,out) i16toeplitza(in1,size1[1],in2,size2[1],out) +#define i162toeplitzi162(in1,size1,out) i16toeplitza(in1,size1[1],in1,size1[1],out) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_TOEPLITZ_H__*/ diff --git a/src/c/matrixOperations/matrix/dmatrixa.c b/src/c/matrixOperations/matrix/dmatrixa.c new file mode 100644 index 0000000..649dbc3 --- /dev/null +++ b/src/c/matrixOperations/matrix/dmatrixa.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function returns cumulative sum of members of array/matrix*/ + +#include "matrix.h" +#include "types.h" +#include "uint16.h" + +void dmatrixa(double *in, int irow, int icolumn, int orow, int ocolumn ,double *out) +{ + int i; + if(irow*icolumn==orow*ocolumn) + { + for(i=0;i<irow*icolumn ; i++) + { + out[i]=in[i]; + } + } + else + { + printf("The given dimensions are not valid for matrix reshaping"); + } +} diff --git a/src/c/matrixOperations/matrix/smatrixa.c b/src/c/matrixOperations/matrix/smatrixa.c new file mode 100644 index 0000000..f432023 --- /dev/null +++ b/src/c/matrixOperations/matrix/smatrixa.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function returns cumulative sum of members of array/matrix*/ + +#include "matrix.h" +#include "types.h" +#include "uint16.h" + +void smatrixa(float *in, int irow, int icolumn, int orow, int ocolumn ,float *out) +{ + int i; + if(irow*icolumn==orow*ocolumn) + { + for(i=0;i<irow*icolumn ; i++) + { + out[i]=in[i]; + } + } + else + { + printf("The given dimensions are not valid for matrix reshaping"); + } +} diff --git a/src/c/matrixOperations/matrix/u16matrixa.c b/src/c/matrixOperations/matrix/u16matrixa.c new file mode 100644 index 0000000..e60d880 --- /dev/null +++ b/src/c/matrixOperations/matrix/u16matrixa.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function returns cumulative sum of members of array/matrix*/ + +#include "matrix.h" +#include "types.h" +#include "uint16.h" + +void u16matrixa(uint16 *in, int irow, int icolumn, int orow, int ocolumn ,uint16 *out) +{ + int i; + if(irow*icolumn==orow*ocolumn) + { + for(i=0;i<irow*icolumn ; i++) + { + out[i]=in[i]; + } + } + else + { + printf("The given dimensions are not valid for matrix reshaping"); + } +} diff --git a/src/c/matrixOperations/matrix/zmatrixa.c b/src/c/matrixOperations/matrix/zmatrixa.c new file mode 100644 index 0000000..5e5651b --- /dev/null +++ b/src/c/matrixOperations/matrix/zmatrixa.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function returns cumulative sum of members of array/matrix*/ + +#include "matrix.h" +#include "types.h" +#include "doubleComplex.h" + +void zmatrixa(doubleComplex *in, int irow, int icolumn, int orow, int ocolumn ,doubleComplex *out) +{ + int i; + if(irow*icolumn==orow*ocolumn) + { + for(i=0;i<irow*icolumn ; i++) + { + out[i]=in[i]; + } + } + else + { + printf("The given dimensions are not valid for matrix reshaping"); + } +} diff --git a/src/c/matrixOperations/nnz/dnnza.c b/src/c/matrixOperations/nnz/dnnza.c new file mode 100644 index 0000000..b4d40bd --- /dev/null +++ b/src/c/matrixOperations/nnz/dnnza.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function returns cumulative sum of members of array/matrix*/ + +#include "nnz.h" +#include "types.h" +#include "uint16.h" + +uint16 dnnza(double *in, int irow, int icolumn) +{ + int i; + uint16 final=0; + for(i=0; i< irow*icolumn ; i++) + { + if( in[i] != 0) + { + final++; + + } + + } +return final; +} diff --git a/src/c/matrixOperations/nnz/dnnzs.c b/src/c/matrixOperations/nnz/dnnzs.c new file mode 100644 index 0000000..c878d33 --- /dev/null +++ b/src/c/matrixOperations/nnz/dnnzs.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function returns cumulative sum of members of array/matrix*/ + +#include "nnz.h" +#include "types.h" +#include "uint16.h" + +uint16 dnnzs(double in) +{ + if(in !=0) + return 1; + else + return 0; +} diff --git a/src/c/matrixOperations/nnz/snnza.c b/src/c/matrixOperations/nnz/snnza.c new file mode 100644 index 0000000..df27f0f --- /dev/null +++ b/src/c/matrixOperations/nnz/snnza.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function returns cumulative sum of members of array/matrix*/ + +#include "nnz.h" +#include "types.h" +#include "uint16.h" + +uint16 snnza(float*in, int irow, int icolumn) +{ + int i; + uint16 final=0; + for(i=0; i< irow*icolumn ; i++) + { + if( in[i] != 0) + { + final++; + + } + + } +return final; +} diff --git a/src/c/matrixOperations/nnz/snnzs.c b/src/c/matrixOperations/nnz/snnzs.c new file mode 100644 index 0000000..674d4fa --- /dev/null +++ b/src/c/matrixOperations/nnz/snnzs.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function returns cumulative sum of members of array/matrix*/ + +#include "nnz.h" +#include "types.h" +#include "uint16.h" + +uint16 snnzs(float in) +{ + if(in !=0) + return 1; + else + return 0; +} diff --git a/src/c/matrixOperations/nnz/znnza.c b/src/c/matrixOperations/nnz/znnza.c new file mode 100644 index 0000000..3b913e8 --- /dev/null +++ b/src/c/matrixOperations/nnz/znnza.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function returns cumulative sum of members of array/matrix*/ + +#include "nnz.h" +#include "types.h" +#include "uint16.h" +#include "doubleComplex.h" +uint16 znnza(doubleComplex* in, int irow, int icolumn) +{ + int i; + uint16 final=0; + for(i=0; i< irow*icolumn ; i++) + { + if(( zreals(in[i]) !=0 )||( zimags(in[i])!=0)) + { + final++; + + } + + } +return final; +} diff --git a/src/c/matrixOperations/nnz/znnzs.c b/src/c/matrixOperations/nnz/znnzs.c new file mode 100644 index 0000000..2907afc --- /dev/null +++ b/src/c/matrixOperations/nnz/znnzs.c @@ -0,0 +1,26 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function returns cumulative sum of members of array/matrix*/ + +#include "nnz.h" +#include "types.h" +#include "uint16.h" +#include "doubleComplex.h" + +uint16 znnzs(doubleComplex in) +{ + if((zreals(in)== 0 ) && (zimags(in)==0)) + return 0; + else + return 1; +} diff --git a/src/c/matrixOperations/norm/dnorma.c b/src/c/matrixOperations/norm/dnorma.c index c912f85..2bb9b8b 100644 --- a/src/c/matrixOperations/norm/dnorma.c +++ b/src/c/matrixOperations/norm/dnorma.c @@ -6,6 +6,8 @@ are also available at http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt Author: Siddhesh Wani + + Edited by: Sandeep Gupta Organization: FOSSEE, IIT Bombay Email: toolbox@scilab.in */ @@ -14,13 +16,17 @@ /*Acceptable norms are: 1, 2, 'inf', 'fro', */ #include "norm.h" +#include "svd.h" #include <math.h> +#include <stdio.h> +#include<stdlib.h> double dnorma (double *in, int row, int col, int norm) { double res = 0, sum = 0; int col_count, row_count; - + double *S; + S = (double *)malloc(min(row,col)*sizeof(double)); switch (norm) { case 1: /*largest column sum*/ @@ -37,6 +43,8 @@ double dnorma (double *in, int row, int col, int norm) break; case 2: /*Largest singular value of the matrix*/ + dsvda(0,in,row,col,0,1,S,NULL,NULL); + res = S[0]; break; case 3: /*inf: largest row sum*/ @@ -69,4 +77,4 @@ double dnorma (double *in, int row, int col, int norm) return res; -}
\ No newline at end of file +} diff --git a/src/c/matrixOperations/spec/Makefile.am b/src/c/matrixOperations/spec/Makefile.am deleted file mode 100644 index 90dbd0a..0000000 --- a/src/c/matrixOperations/spec/Makefile.am +++ /dev/null @@ -1,70 +0,0 @@ -## -## Scilab ( http://www.scilab.org/ ) - This file is part of Scilab -## Copyright (C) 2006-2008 - INRIA - Bruno JOFRET -## -## This file must be used under the terms of the CeCILL. -## This source file is licensed as described in the file COPYING, which -## you should have received as part of this distribution. The terms -## are also available at -## http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -## -## - -libSpec_la_CFLAGS = -I $(top_builddir)/src/c/type \ - -I $(top_builddir)/src/c/matrixOperations/includes \ - -I $(top_builddir)/src/c/operations/includes \ - -I $(top_builddir)/src/c/elementaryFunctions/includes\ - -I $(top_builddir)/src/c/auxiliaryFunctions/includes - - -instdir = $(top_builddir)/lib - -pkglib_LTLIBRARIES = libSpec.la - -HEAD = ../includes/spec.h - -libSpec_la_SOURCES = $(HEAD) \ - sspeca.c \ - dspeca.c \ - cspeca.c \ - zspeca.c - - -############ -## CHECK -############ - - -check_PROGRAMS = testDoubleSpec testFloatSpec - -check_LDADD = $(top_builddir)/src/c/type/libDoubleComplex.la \ - $(top_builddir)/src/c/type/libFloatComplex.la \ - $(top_builddir)/src/c/elementaryFunctions/sqrt/libSqrt.la \ - $(top_builddir)/src/fortran/lapack/libscilapack.la \ - $(top_builddir)/src/fortran/blas/libsciblas.la \ - $(top_builddir)/src/c/auxiliaryFunctions/abs/libAbs.la \ - $(top_builddir)/src/c/auxiliaryFunctions/conj/libConj.la \ - $(top_builddir)/src/c/auxiliaryFunctions/sign/libSign.la \ - $(top_builddir)/src/c/auxiliaryFunctions/pythag/libPythag.la \ - $(top_builddir)/src/c/operations/addition/libAddition.la \ - $(top_builddir)/src/c/operations/multiplication/libMultiplication.la \ - $(top_builddir)/src/c/matrixOperations/inversion/libMatrixInversion.la\ - $(top_builddir)/src/c/matrixOperations/zeros/libMatrixZeros.la\ - libSpec.la - -check_INCLUDES = -I $(top_builddir)/src/c/type \ - -I $(top_builddir)/src/c/matrixOperations/includes \ - -I $(top_builddir)/src/c/operations/includes \ - -I $(top_builddir)/src/c/elementaryFunctions/includes\ - -I $(top_builddir)/src/c/auxiliaryFunctions/includes - -testDoubleSpec_SOURCES = testDoubleSpec.c -testDoubleSpec_LDADD = $(check_LDADD) -testDoubleSpec_CFLAGS = $(check_INCLUDES) - -testFloatSpec_SOURCES = testFloatSpec.c -testFloatSpec_LDADD = $(check_LDADD) -testFloatSpec_CFLAGS = $(check_INCLUDES) - -TESTS = testDoubleSpec testFloatSpec - diff --git a/src/c/matrixOperations/spec/Makefile.in b/src/c/matrixOperations/spec/Makefile.in deleted file mode 100644 index 9c34c9e..0000000 --- a/src/c/matrixOperations/spec/Makefile.in +++ /dev/null @@ -1,755 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -check_PROGRAMS = testDoubleSpec$(EXEEXT) testFloatSpec$(EXEEXT) -TESTS = testDoubleSpec$(EXEEXT) testFloatSpec$(EXEEXT) -subdir = src/c/matrixOperations/spec -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/includes/machine.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -libSpec_la_LIBADD = -am__objects_1 = -am_libSpec_la_OBJECTS = $(am__objects_1) libSpec_la-sspeca.lo \ - libSpec_la-dspeca.lo libSpec_la-cspeca.lo libSpec_la-zspeca.lo -libSpec_la_OBJECTS = $(am_libSpec_la_OBJECTS) -libSpec_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libSpec_la_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am_testDoubleSpec_OBJECTS = testDoubleSpec-testDoubleSpec.$(OBJEXT) -testDoubleSpec_OBJECTS = $(am_testDoubleSpec_OBJECTS) -testDoubleSpec_DEPENDENCIES = $(check_LDADD) -testDoubleSpec_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testDoubleSpec_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am_testFloatSpec_OBJECTS = testFloatSpec-testFloatSpec.$(OBJEXT) -testFloatSpec_OBJECTS = $(am_testFloatSpec_OBJECTS) -testFloatSpec_DEPENDENCIES = $(check_LDADD) -testFloatSpec_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testFloatSpec_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/includes -depcomp = $(SHELL) $(top_srcdir)/config/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(libSpec_la_SOURCES) $(testDoubleSpec_SOURCES) \ - $(testFloatSpec_SOURCES) -DIST_SOURCES = $(libSpec_la_SOURCES) $(testDoubleSpec_SOURCES) \ - $(testFloatSpec_SOURCES) -ETAGS = etags -CTAGS = ctags -am__tty_colors = \ -red=; grn=; lgn=; blu=; std= -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FGREP = @FGREP@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBMATH = @LIBMATH@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_ct_F77 = @ac_ct_F77@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -libSpec_la_CFLAGS = -I $(top_builddir)/src/c/type \ - -I $(top_builddir)/src/c/matrixOperations/includes \ - -I $(top_builddir)/src/c/operations/includes \ - -I $(top_builddir)/src/c/elementaryFunctions/includes\ - -I $(top_builddir)/src/c/auxiliaryFunctions/includes - -instdir = $(top_builddir)/lib -pkglib_LTLIBRARIES = libSpec.la -HEAD = ../includes/spec.h -libSpec_la_SOURCES = $(HEAD) \ - sspeca.c \ - dspeca.c \ - cspeca.c \ - zspeca.c - -check_LDADD = $(top_builddir)/src/c/type/libDoubleComplex.la \ - $(top_builddir)/src/c/type/libFloatComplex.la \ - $(top_builddir)/src/c/elementaryFunctions/sqrt/libSqrt.la \ - $(top_builddir)/src/fortran/lapack/libscilapack.la \ - $(top_builddir)/src/fortran/blas/libsciblas.la \ - $(top_builddir)/src/c/auxiliaryFunctions/abs/libAbs.la \ - $(top_builddir)/src/c/auxiliaryFunctions/conj/libConj.la \ - $(top_builddir)/src/c/auxiliaryFunctions/sign/libSign.la \ - $(top_builddir)/src/c/auxiliaryFunctions/pythag/libPythag.la \ - $(top_builddir)/src/c/operations/addition/libAddition.la \ - $(top_builddir)/src/c/operations/multiplication/libMultiplication.la \ - $(top_builddir)/src/c/matrixOperations/inversion/libMatrixInversion.la\ - $(top_builddir)/src/c/matrixOperations/zeros/libMatrixZeros.la\ - libSpec.la - -check_INCLUDES = -I $(top_builddir)/src/c/type \ - -I $(top_builddir)/src/c/matrixOperations/includes \ - -I $(top_builddir)/src/c/operations/includes \ - -I $(top_builddir)/src/c/elementaryFunctions/includes\ - -I $(top_builddir)/src/c/auxiliaryFunctions/includes - -testDoubleSpec_SOURCES = testDoubleSpec.c -testDoubleSpec_LDADD = $(check_LDADD) -testDoubleSpec_CFLAGS = $(check_INCLUDES) -testFloatSpec_SOURCES = testFloatSpec.c -testFloatSpec_LDADD = $(check_LDADD) -testFloatSpec_CFLAGS = $(check_INCLUDES) -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/c/matrixOperations/spec/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/c/matrixOperations/spec/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libSpec.la: $(libSpec_la_OBJECTS) $(libSpec_la_DEPENDENCIES) - $(libSpec_la_LINK) -rpath $(pkglibdir) $(libSpec_la_OBJECTS) $(libSpec_la_LIBADD) $(LIBS) - -clean-checkPROGRAMS: - @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list -testDoubleSpec$(EXEEXT): $(testDoubleSpec_OBJECTS) $(testDoubleSpec_DEPENDENCIES) - @rm -f testDoubleSpec$(EXEEXT) - $(testDoubleSpec_LINK) $(testDoubleSpec_OBJECTS) $(testDoubleSpec_LDADD) $(LIBS) -testFloatSpec$(EXEEXT): $(testFloatSpec_OBJECTS) $(testFloatSpec_DEPENDENCIES) - @rm -f testFloatSpec$(EXEEXT) - $(testFloatSpec_LINK) $(testFloatSpec_OBJECTS) $(testFloatSpec_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSpec_la-cspeca.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSpec_la-dspeca.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSpec_la-sspeca.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSpec_la-zspeca.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testDoubleSpec-testDoubleSpec.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testFloatSpec-testFloatSpec.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -libSpec_la-sspeca.lo: sspeca.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec_la_CFLAGS) $(CFLAGS) -MT libSpec_la-sspeca.lo -MD -MP -MF $(DEPDIR)/libSpec_la-sspeca.Tpo -c -o libSpec_la-sspeca.lo `test -f 'sspeca.c' || echo '$(srcdir)/'`sspeca.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libSpec_la-sspeca.Tpo $(DEPDIR)/libSpec_la-sspeca.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sspeca.c' object='libSpec_la-sspeca.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec_la_CFLAGS) $(CFLAGS) -c -o libSpec_la-sspeca.lo `test -f 'sspeca.c' || echo '$(srcdir)/'`sspeca.c - -libSpec_la-dspeca.lo: dspeca.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec_la_CFLAGS) $(CFLAGS) -MT libSpec_la-dspeca.lo -MD -MP -MF $(DEPDIR)/libSpec_la-dspeca.Tpo -c -o libSpec_la-dspeca.lo `test -f 'dspeca.c' || echo '$(srcdir)/'`dspeca.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libSpec_la-dspeca.Tpo $(DEPDIR)/libSpec_la-dspeca.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dspeca.c' object='libSpec_la-dspeca.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec_la_CFLAGS) $(CFLAGS) -c -o libSpec_la-dspeca.lo `test -f 'dspeca.c' || echo '$(srcdir)/'`dspeca.c - -libSpec_la-cspeca.lo: cspeca.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec_la_CFLAGS) $(CFLAGS) -MT libSpec_la-cspeca.lo -MD -MP -MF $(DEPDIR)/libSpec_la-cspeca.Tpo -c -o libSpec_la-cspeca.lo `test -f 'cspeca.c' || echo '$(srcdir)/'`cspeca.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libSpec_la-cspeca.Tpo $(DEPDIR)/libSpec_la-cspeca.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cspeca.c' object='libSpec_la-cspeca.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec_la_CFLAGS) $(CFLAGS) -c -o libSpec_la-cspeca.lo `test -f 'cspeca.c' || echo '$(srcdir)/'`cspeca.c - -libSpec_la-zspeca.lo: zspeca.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec_la_CFLAGS) $(CFLAGS) -MT libSpec_la-zspeca.lo -MD -MP -MF $(DEPDIR)/libSpec_la-zspeca.Tpo -c -o libSpec_la-zspeca.lo `test -f 'zspeca.c' || echo '$(srcdir)/'`zspeca.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libSpec_la-zspeca.Tpo $(DEPDIR)/libSpec_la-zspeca.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zspeca.c' object='libSpec_la-zspeca.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec_la_CFLAGS) $(CFLAGS) -c -o libSpec_la-zspeca.lo `test -f 'zspeca.c' || echo '$(srcdir)/'`zspeca.c - -testDoubleSpec-testDoubleSpec.o: testDoubleSpec.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSpec_CFLAGS) $(CFLAGS) -MT testDoubleSpec-testDoubleSpec.o -MD -MP -MF $(DEPDIR)/testDoubleSpec-testDoubleSpec.Tpo -c -o testDoubleSpec-testDoubleSpec.o `test -f 'testDoubleSpec.c' || echo '$(srcdir)/'`testDoubleSpec.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/testDoubleSpec-testDoubleSpec.Tpo $(DEPDIR)/testDoubleSpec-testDoubleSpec.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleSpec.c' object='testDoubleSpec-testDoubleSpec.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSpec_CFLAGS) $(CFLAGS) -c -o testDoubleSpec-testDoubleSpec.o `test -f 'testDoubleSpec.c' || echo '$(srcdir)/'`testDoubleSpec.c - -testDoubleSpec-testDoubleSpec.obj: testDoubleSpec.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSpec_CFLAGS) $(CFLAGS) -MT testDoubleSpec-testDoubleSpec.obj -MD -MP -MF $(DEPDIR)/testDoubleSpec-testDoubleSpec.Tpo -c -o testDoubleSpec-testDoubleSpec.obj `if test -f 'testDoubleSpec.c'; then $(CYGPATH_W) 'testDoubleSpec.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleSpec.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/testDoubleSpec-testDoubleSpec.Tpo $(DEPDIR)/testDoubleSpec-testDoubleSpec.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleSpec.c' object='testDoubleSpec-testDoubleSpec.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSpec_CFLAGS) $(CFLAGS) -c -o testDoubleSpec-testDoubleSpec.obj `if test -f 'testDoubleSpec.c'; then $(CYGPATH_W) 'testDoubleSpec.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleSpec.c'; fi` - -testFloatSpec-testFloatSpec.o: testFloatSpec.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSpec_CFLAGS) $(CFLAGS) -MT testFloatSpec-testFloatSpec.o -MD -MP -MF $(DEPDIR)/testFloatSpec-testFloatSpec.Tpo -c -o testFloatSpec-testFloatSpec.o `test -f 'testFloatSpec.c' || echo '$(srcdir)/'`testFloatSpec.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/testFloatSpec-testFloatSpec.Tpo $(DEPDIR)/testFloatSpec-testFloatSpec.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatSpec.c' object='testFloatSpec-testFloatSpec.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSpec_CFLAGS) $(CFLAGS) -c -o testFloatSpec-testFloatSpec.o `test -f 'testFloatSpec.c' || echo '$(srcdir)/'`testFloatSpec.c - -testFloatSpec-testFloatSpec.obj: testFloatSpec.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSpec_CFLAGS) $(CFLAGS) -MT testFloatSpec-testFloatSpec.obj -MD -MP -MF $(DEPDIR)/testFloatSpec-testFloatSpec.Tpo -c -o testFloatSpec-testFloatSpec.obj `if test -f 'testFloatSpec.c'; then $(CYGPATH_W) 'testFloatSpec.c'; else $(CYGPATH_W) '$(srcdir)/testFloatSpec.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/testFloatSpec-testFloatSpec.Tpo $(DEPDIR)/testFloatSpec-testFloatSpec.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatSpec.c' object='testFloatSpec-testFloatSpec.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSpec_CFLAGS) $(CFLAGS) -c -o testFloatSpec-testFloatSpec.obj `if test -f 'testFloatSpec.c'; then $(CYGPATH_W) 'testFloatSpec.c'; else $(CYGPATH_W) '$(srcdir)/testFloatSpec.c'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; skip=0; \ - srcdir=$(srcdir); export srcdir; \ - list=' $(TESTS) '; \ - $(am__tty_colors); \ - if test -n "$$list"; then \ - for tst in $$list; do \ - if test -f ./$$tst; then dir=./; \ - elif test -f $$tst; then dir=; \ - else dir="$(srcdir)/"; fi; \ - if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$tst[\ \ ]*) \ - xpass=`expr $$xpass + 1`; \ - failed=`expr $$failed + 1`; \ - col=$$red; res=XPASS; \ - ;; \ - *) \ - col=$$grn; res=PASS; \ - ;; \ - esac; \ - elif test $$? -ne 77; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$tst[\ \ ]*) \ - xfail=`expr $$xfail + 1`; \ - col=$$lgn; res=XFAIL; \ - ;; \ - *) \ - failed=`expr $$failed + 1`; \ - col=$$red; res=FAIL; \ - ;; \ - esac; \ - else \ - skip=`expr $$skip + 1`; \ - col=$$blu; res=SKIP; \ - fi; \ - echo "$${col}$$res$${std}: $$tst"; \ - done; \ - if test "$$all" -eq 1; then \ - tests="test"; \ - All=""; \ - else \ - tests="tests"; \ - All="All "; \ - fi; \ - if test "$$failed" -eq 0; then \ - if test "$$xfail" -eq 0; then \ - banner="$$All$$all $$tests passed"; \ - else \ - if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ - banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ - fi; \ - else \ - if test "$$xpass" -eq 0; then \ - banner="$$failed of $$all $$tests failed"; \ - else \ - if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ - banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ - fi; \ - fi; \ - dashes="$$banner"; \ - skipped=""; \ - if test "$$skip" -ne 0; then \ - if test "$$skip" -eq 1; then \ - skipped="($$skip test was not run)"; \ - else \ - skipped="($$skip tests were not run)"; \ - fi; \ - test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$skipped"; \ - fi; \ - report=""; \ - if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ - report="Please report to $(PACKAGE_BUGREPORT)"; \ - test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$report"; \ - fi; \ - dashes=`echo "$$dashes" | sed s/./=/g`; \ - if test "$$failed" -eq 0; then \ - echo "$$grn$$dashes"; \ - else \ - echo "$$red$$dashes"; \ - fi; \ - echo "$$banner"; \ - test -z "$$skipped" || echo "$$skipped"; \ - test -z "$$report" || echo "$$report"; \ - echo "$$dashes$$std"; \ - test "$$failed" -eq 0; \ - else :; fi - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) - $(MAKE) $(AM_MAKEFLAGS) check-TESTS -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ - clean-pkglibLTLIBRARIES mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: check-am install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ - clean-checkPROGRAMS clean-generic clean-libtool \ - clean-pkglibLTLIBRARIES ctags distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-pkglibLTLIBRARIES install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/c/matrixOperations/spec/cspeca.c b/src/c/matrixOperations/spec/cspeca.c deleted file mode 100644 index a2b6548..0000000 --- a/src/c/matrixOperations/spec/cspeca.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ - -#include <stdlib.h> -#include "spec.h" - - - -void cspeca(floatComplex* in, int rows, floatComplex* out){ - /* As we use Lapack to find the eigenvalues, we must cast the floatComplex input into doubleComplex - and the doubleComplex output of dspeca into floatComplex*/ - - int i; - doubleComplex* dblin; - doubleComplex* dblout; - - dblin=(doubleComplex*)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); - dblout=(doubleComplex*)malloc((unsigned int)rows*sizeof(doubleComplex)); - - for (i=0;i<rows*rows;i++) dblin[i]=DoubleComplex((double)creals(in[i]),(double)cimags(in[i])); - - zspeca(dblin,rows,dblout); - - for (i=0;i<rows;i++) out[i]=FloatComplex((float)zreals(dblout[i]),(float)zimags(dblout[i])); -} diff --git a/src/c/matrixOperations/spec/dspeca.c b/src/c/matrixOperations/spec/dspeca.c deleted file mode 100644 index 1131ecf..0000000 --- a/src/c/matrixOperations/spec/dspeca.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ - -#include <stdlib.h> -#include "spec.h" -#include "lapack.h" -#include "zeros.h" -#include "max.h" - -void dspeca(double* in, int rows,double* out){ - int i=0, j=0; - int symmetric=0; - int INFO=0; - int iWorkSize = 0; - double* pdblWork; - double* outReal; - double* outImag; - double* pdblLeftvectors; - double* pdblRightvectors; - double* inCopy; - - inCopy = (double*)malloc((unsigned int)(rows*rows) * sizeof(double)); - outReal = (double*)malloc((unsigned int)rows * sizeof(double)); - outImag = (double*)malloc((unsigned int)rows * sizeof(double)); - pdblLeftvectors=NULL; - pdblRightvectors=NULL; - - - iWorkSize = 3*rows; - pdblWork = (double*)malloc((unsigned int)iWorkSize * sizeof(double)); - - for(i=0;i<rows*rows;i++) inCopy[i]=in[i]; - /* look if the matrix is symmetric */ - for (i=0;i<rows;i++) - for (j=0;j<rows;j++) - if (in[i*rows+j]!=in[i+j*rows]) break; - - /* the matrix is symmetric if the 2 loops goes to end i.e - i==rows and j==rows */ - if ((i==rows)&&(j==rows)) symmetric=1; - - - /* apply lapack function according to symmetry */ - if(symmetric){ - C2F(dsyev)( "N", "U", &rows, in, &rows, outReal, pdblWork, &iWorkSize, &INFO ); - } - else { - C2F(dgeev)( "N", "N", &rows, inCopy, &rows, outReal, outImag, - pdblLeftvectors, &rows, pdblRightvectors, &rows, pdblWork, &iWorkSize, &INFO ); - } - - for (i=0;i<rows;i++) out[i]=outReal[i]; - - - free(inCopy); - free(outReal); - free(outImag); - free(pdblWork); - free(pdblLeftvectors); - free(pdblRightvectors); -} - diff --git a/src/c/matrixOperations/spec/sspeca.c b/src/c/matrixOperations/spec/sspeca.c deleted file mode 100644 index 50751a2..0000000 --- a/src/c/matrixOperations/spec/sspeca.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ - -#include <stdlib.h> -#include "spec.h" - - - -void sspeca(float* in, int rows, float* out){ - /* As we use Lapack to find the eigenvalues, we must cast the float input into double - and the doubleComplex output of dspeca into floatComplex*/ - - int i; - double* dblin; - double* dblout; - - dblin=(double*)malloc((unsigned int)(rows*rows)*sizeof(double)); - dblout=(double*)malloc((unsigned int)rows*sizeof(double)); - - for (i=0;i<rows*rows;i++) dblin[i]=(double)in[i]; - - dspeca(dblin,rows,dblout); - - for (i=0;i<rows;i++) out[i]=(float)dblout[i]; -} diff --git a/src/c/matrixOperations/spec/testDoubleSpec.c b/src/c/matrixOperations/spec/testDoubleSpec.c deleted file mode 100644 index 25c8806..0000000 --- a/src/c/matrixOperations/spec/testDoubleSpec.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ - -#include <stdlib.h> -#include "spec.h" -#include "stdio.h" -#include "assert.h" -#include "math.h" - -static void dspecaTest(void){ - double in[4]={1,1,1,3}; - double resultR[2]={0.5857864376269050765700,3.4142135623730949234300}; - - - double *out; - - int i; - - out=(double*)malloc((unsigned int)2*sizeof(double)); - - dspeca(in,2,out); - for(i=0;i<2;i++){ - if (out[i]>1e-16) assert( fabs(out[i]-resultR[i]) / fabs(out[i]) <3e-16); - else assert(1); - } - -} - - - - -static void zspecaTest(void){ - double inR[4]={1,1,1,3}; - double inI[4]={0,0,0,0}; - double resultR[2]={0.5857864376269050765700,3.4142135623730949234300}; - double resultI[2]={0,0}; - - double in2R[4]={1,1,-2,3}; - double in2I[4]={0,0,0,0}; - double result2R[2]={1.9999999999999997779554,1.9999999999999997779554}; - double result2I[2]={0.9999999999999997779554,-0.9999999999999997779554}; - - double in3R[16]={0.0603054538369178771973,0.631347181741148233414 ,0.0241030259057879447937,0.1527438252232968807221, - 0.9481177683919668197632,0.2744265575893223285675,0.4794727200642228126526,0.485576837789267301559, - 0.676400367170572280884,0.8321249918080866336823,0.0125875836238265037537,0.5453779897652566432953, - 0.8426716942340135574341,0.9029165101237595081329,0.4409482078626751899719,0.8332359003834426403046 }; - double in3I[16]={0.7233976423740386962891,0.4377150186337530612946,0.3080607382580637931824,0.8749813153408467769623, - 0.5355882328003644943237 ,0.3085998897440731525421,0.3354632416740059852600,0.2342486302368342876434, - 0.2589411698281764984131,0.8521509231068193912506,0.4821739485487341880798,0.6095217890106141567230, - 0.9872822705656290054321,0.9811426815576851367950,0.3303113700821995735169,0.3589145573787391185761}; - double result3R[4]={1.9486046375762748894545,0.2315060459861970343365,- 0.7694743345806510648188,- 0.2300808535483104266817}; - double result3I[4]={2.1242015857341254303492,- 0.4115101262891645017561,- 0.1980716835789462781925,0.3584662621795701720195}; - - doubleComplex *in,*in2,*in3,out[2],out2[4]; - - int i; - - in=DoubleComplexMatrix(inR,inI,4); - in2=DoubleComplexMatrix(in2R,in2I,4); - in3=DoubleComplexMatrix(in3R,in3I,16); - - zspeca(in,2,out); - for(i=0;i<2;i++){ - if (zreals(out[i])>1e-16) assert( fabs(zreals(out[i])-resultR[i]) / fabs(zreals(out[i])) <3e-16); - else assert(1); - if (zimags(out[i])>1e-16) assert( fabs(zimags(out[i])-resultI[i]) / fabs(zimags(out[i])) <1e-16); - else assert(1); - } - - - zspeca(in2,2,out); - for(i=0;i<2;i++){ - if (zreals(out[i])>1e-16) assert( fabs(zreals(out[i])-result2R[i]) / fabs(zreals(out[i])) <3e-16); - else assert(1); - if (zimags(out[i])>1e-16) assert( fabs(zimags(out[i])-result2I[i]) / fabs(zimags(out[i])) <3e-15); - else assert(1); - } - - - zspeca(in3,4,out2); - for(i=0;i<4;i++){ - if (zreals(out2[i])>1e-16) assert( fabs(zreals(out2[i])-result3R[i]) / fabs(zreals(out2[i])) <3e-15); - else assert(1); - if (zimags(out2[i])>1e-16) assert( fabs(zimags(out2[i])-result3I[i]) / fabs(zimags(out2[i])) <3e-15); - else assert(1); - } - - -} - - -static int testSpec(void){ - printf(">>> Double Spec Tests <<<\n"); - printf(">>> Double <<<\n"); - dspecaTest(); - printf(">>> DoubleComplex <<<\n"); - zspecaTest(); - return 0; -} - - -int main(void){ - assert (testSpec()==0); - - - return 0; -} diff --git a/src/c/matrixOperations/spec/testFloatSpec.c b/src/c/matrixOperations/spec/testFloatSpec.c deleted file mode 100644 index 9bd46ad..0000000 --- a/src/c/matrixOperations/spec/testFloatSpec.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ - -#include <stdlib.h> -#include "spec.h" -#include "stdio.h" -#include "assert.h" -#include "math.h" - -static void sspecaTest(void){ - float in[4]={1.0f,1.0f,1.0f,3.0f}; - float resultR[2]={0.5857864376269050765700f,3.4142135623730949234300f}; - - float in1[4]={0.0f,4.0f,1.0f,0.0f}; - float result[2]={2.0f,-2.0f}; - - float in2[4]={1.0f,1.0f,-2.0f,3.0f}; - - float *out; - - int i; - - out=(float *)malloc((unsigned int)2*sizeof(float)); - - sspeca(in,2,out); - for (i=0;i<2;i++) printf("%f\n",out[i]); - for(i=0;i<2;i++){ - if (out[i]>1e-16) assert( fabs(out[i]-resultR[i]) / fabs(out[i]) <1e-16); - else assert(1); - } - - - sspeca(in1,2,out); - for (i=0;i<2;i++) printf("%f\n",out[i]); - for(i=0;i<2;i++){ - if (out[i]>1e-16) assert( fabs(out[i]-result[i]) / fabs(out[i]) <1e-16); - else assert(1); - } - - sspeca(in2,2,out); - for (i=0;i<2;i++) printf("%f\n",out[i]); - -} - - -static void cspecaTest(void){ - float inR[4]={1.0f,1.0f,1.0f,3.0f}; - float inI[4]={0.0f,0.0f,0.0f,0.0f}; - float resultR[2]={0.5857864376269050765700f,3.4142135623730949234300f}; - float resultI[2]={0,0}; - - float in2R[4]={1.0f,1.0f,-2.0f,3.0f}; - float in2I[4]={0.0f,0.0f,0.0f,0.0f}; - float result2R[2]={1.9999999999999997779554f,1.9999999999999997779554f}; - float result2I[2]={0.9999999999999997779554f,-0.9999999999999997779554f}; - - floatComplex *in,*in2,out[4]; - - int i; - - in=FloatComplexMatrix(inR,inI,4); - in2=FloatComplexMatrix(in2R,in2I,4); - - cspeca(in,2,out); - for(i=0;i<2;i++){ - if (creals(out[i])>1e-16) assert( fabs(creals(out[i])-resultR[i]) / fabs(creals(out[i])) <1e-15); - else assert(1); - if (cimags(out[i])>1e-16) assert( fabs(cimags(out[i])-resultI[i]) / fabs(cimags(out[i])) <1e-16); - else assert(1); - } - - - cspeca(in2,2,out); - for(i=0;i<2;i++){ - if (creals(out[i])>1e-16) assert( fabs(creals(out[i])-result2R[i]) / fabs(creals(out[i])) <1e-15); - else assert(1); - if (cimags(out[i])>1e-16) assert( fabs(cimags(out[i])-result2I[i]) / fabs(cimags(out[i])) <1e-15); - else assert(1); - } - -} - - - - -static int testSpec(void){ - printf(">>> Float Spec Tests <<<\n"); - printf(">>> Float <<<\n"); - sspecaTest(); - printf(">>> FloatComplex <<<\n"); - cspecaTest(); - return 0; -} - - -int main(void){ - assert (testSpec()==0); - - - return 0; -} diff --git a/src/c/matrixOperations/spec/test_DoubleSpec/testDoubleSpec.vcxproj b/src/c/matrixOperations/spec/test_DoubleSpec/testDoubleSpec.vcxproj deleted file mode 100644 index f696bff..0000000 --- a/src/c/matrixOperations/spec/test_DoubleSpec/testDoubleSpec.vcxproj +++ /dev/null @@ -1,178 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{651B0E61-1047-4575-BE31-D9CB28062CBA}</ProjectGuid>
- <RootNamespace>testDoubleSpec</RootNamespace>
- <Keyword>Win32Proj</Keyword>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="..\testDoubleSpec.c">
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\..\type\type.vcxproj">
- <Project>{9b1bd750-1fef-4d6b-9422-782d16181cee}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- <ProjectReference Include="..\..\matrixOperations.vcxproj">
- <Project>{fd335544-52bf-4736-a34e-77f591d158d5}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file diff --git a/src/c/matrixOperations/spec/test_DoubleSpec/testDoubleSpec.vcxproj.filters b/src/c/matrixOperations/spec/test_DoubleSpec/testDoubleSpec.vcxproj.filters deleted file mode 100644 index dcdaea5..0000000 --- a/src/c/matrixOperations/spec/test_DoubleSpec/testDoubleSpec.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\testDoubleSpec.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
-</Project>
\ No newline at end of file diff --git a/src/c/matrixOperations/spec/test_FloatSpec/testFloatSpec.vcxproj b/src/c/matrixOperations/spec/test_FloatSpec/testFloatSpec.vcxproj deleted file mode 100644 index 0631bb4..0000000 --- a/src/c/matrixOperations/spec/test_FloatSpec/testFloatSpec.vcxproj +++ /dev/null @@ -1,178 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{B7BEF8A2-3E42-4FA3-94A7-22618594057D}</ProjectGuid>
- <RootNamespace>testFloatSpec</RootNamespace>
- <Keyword>Win32Proj</Keyword>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="..\testFloatSpec.c">
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\..\type\type.vcxproj">
- <Project>{9b1bd750-1fef-4d6b-9422-782d16181cee}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- <ProjectReference Include="..\..\matrixOperations.vcxproj">
- <Project>{fd335544-52bf-4736-a34e-77f591d158d5}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file diff --git a/src/c/matrixOperations/spec/test_FloatSpec/testFloatSpec.vcxproj.filters b/src/c/matrixOperations/spec/test_FloatSpec/testFloatSpec.vcxproj.filters deleted file mode 100644 index 2ba2e59..0000000 --- a/src/c/matrixOperations/spec/test_FloatSpec/testFloatSpec.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\testFloatSpec.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
-</Project>
\ No newline at end of file diff --git a/src/c/matrixOperations/spec/zspeca.c b/src/c/matrixOperations/spec/zspeca.c deleted file mode 100644 index a2b1c25..0000000 --- a/src/c/matrixOperations/spec/zspeca.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ - -#include <stdlib.h> -#include "spec.h" -#include "lapack.h" -#include "zeros.h" -#include "conj.h" - -void zspeca(doubleComplex* in, int rows,doubleComplex* out){ - int i = 0, j = 0; - int hermitian = 0; - int INFO = 0; - int iWorkSize = 0; - doubleComplex* pdblWork; - doubleComplex* pdblLeftvectors; - doubleComplex* pdblRightvectors; - doubleComplex* pdblRWork; - double* outReal; - double* outImag; - doubleComplex* inCopy; - - inCopy = (doubleComplex*)malloc((unsigned int)(rows*rows) * sizeof(doubleComplex)); - outReal = (double*)malloc((unsigned int)rows * sizeof(double)); - outImag = (double*)malloc((unsigned int)rows * sizeof(double)); - pdblLeftvectors=NULL; - pdblRightvectors=NULL; - - iWorkSize = 2*rows; - pdblWork = (doubleComplex*)malloc((unsigned int)iWorkSize * sizeof(doubleComplex)); - pdblRWork = (doubleComplex*)malloc((unsigned int)(3*rows) * sizeof(doubleComplex)); - - for(i=0;i<rows*rows;i++) inCopy[i]=DoubleComplex(zreals(in[i]),zimags(in[i])); - - /* look if the matrix is symmetric */ - for (i=0;i<rows;i++){ - for (j=0;j<rows;j++) - if ( (zreals(in[i*rows+j])!=zreals(zconjs(in[i+j*rows]))) || - (zimags(in[i*rows+j])!=zimags(zconjs(in[i+j*rows]))) ) - break; - if (j!=rows) break; - } - - - /* the matrix is symmetric if the 2 loops goes to end i.e - i==rows and j==rows */ - if ((i==rows)&&(j==rows)) hermitian=1; - - - /* apply lapack function according to symmetry */ - if(hermitian){ - C2F(zheev)( "N", "U", &rows, inCopy, &rows, outReal, pdblWork, &iWorkSize, outImag, &INFO ); - dzerosa(outImag,1,rows); - for (i=0;i<rows;i++) out[i]=DoubleComplex(outReal[i],outImag[i]); - } - else { - C2F(zgeev)( "N", "N", &rows, inCopy, &rows, out, - pdblLeftvectors, &rows, pdblRightvectors, &rows, pdblWork, &iWorkSize, - pdblRWork, &INFO ); - } - - - - free(inCopy); - free(outReal); - free(outImag); - free(pdblWork); - free(pdblRWork); - free(pdblLeftvectors); - free(pdblRightvectors); -} diff --git a/src/c/matrixOperations/spec2/Makefile.am b/src/c/matrixOperations/spec2/Makefile.am deleted file mode 100644 index 5a357fa..0000000 --- a/src/c/matrixOperations/spec2/Makefile.am +++ /dev/null @@ -1,70 +0,0 @@ -## -## Scilab ( http://www.scilab.org/ ) - This file is part of Scilab -## Copyright (C) 2006-2008 - INRIA - Bruno JOFRET -## -## This file must be used under the terms of the CeCILL. -## This source file is licensed as described in the file COPYING, which -## you should have received as part of this distribution. The terms -## are also available at -## http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -## -## - -libSpec2_la_CFLAGS = -I $(top_builddir)/src/c/type \ - -I $(top_builddir)/src/c/matrixOperations/includes \ - -I $(top_builddir)/src/c/operations/includes \ - -I $(top_builddir)/src/c/elementaryFunctions/includes\ - -I $(top_builddir)/src/c/auxiliaryFunctions/includes - - -instdir = $(top_builddir)/lib - -pkglib_LTLIBRARIES = libSpec2.la - -HEAD = ../includes/spec.h - -libSpec2_la_SOURCES = $(HEAD) \ - sspec2a.c \ - dspec2a.c \ - cspec2a.c \ - zspec2a.c - - -############ -## CHECK -############ - - -check_PROGRAMS = testDoubleSpec2 testFloatSpec2 - -check_LDADD = $(top_builddir)/src/c/type/libDoubleComplex.la \ - $(top_builddir)/src/c/type/libFloatComplex.la \ - $(top_builddir)/src/c/elementaryFunctions/sqrt/libSqrt.la \ - $(top_builddir)/src/fortran/lapack/libscilapack.la \ - $(top_builddir)/src/fortran/blas/libsciblas.la \ - $(top_builddir)/src/c/auxiliaryFunctions/abs/libAbs.la \ - $(top_builddir)/src/c/auxiliaryFunctions/conj/libConj.la \ - $(top_builddir)/src/c/auxiliaryFunctions/sign/libSign.la \ - $(top_builddir)/src/c/auxiliaryFunctions/pythag/libPythag.la \ - $(top_builddir)/src/c/operations/addition/libAddition.la \ - $(top_builddir)/src/c/operations/multiplication/libMultiplication.la \ - $(top_builddir)/src/c/matrixOperations/inversion/libMatrixInversion.la\ - $(top_builddir)/src/c/matrixOperations/zeros/libMatrixZeros.la\ - libSpec2.la - -check_INCLUDES = -I $(top_builddir)/src/c/type \ - -I $(top_builddir)/src/c/matrixOperations/includes \ - -I $(top_builddir)/src/c/operations/includes \ - -I $(top_builddir)/src/c/elementaryFunctions/includes\ - -I $(top_builddir)/src/c/auxiliaryFunctions/includes - -testDoubleSpec2_SOURCES = testDoubleSpec2.c -testDoubleSpec2_LDADD = $(check_LDADD) -testDoubleSpec2_CFLAGS = $(check_INCLUDES) - -testFloatSpec2_SOURCES = testFloatSpec2.c -testFloatSpec2_LDADD = $(check_LDADD) -testFloatSpec2_CFLAGS = $(check_INCLUDES) - -TESTS = testDoubleSpec2 testFloatSpec2 - diff --git a/src/c/matrixOperations/spec2/Makefile.in b/src/c/matrixOperations/spec2/Makefile.in deleted file mode 100644 index 6e46c05..0000000 --- a/src/c/matrixOperations/spec2/Makefile.in +++ /dev/null @@ -1,757 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -check_PROGRAMS = testDoubleSpec2$(EXEEXT) testFloatSpec2$(EXEEXT) -TESTS = testDoubleSpec2$(EXEEXT) testFloatSpec2$(EXEEXT) -subdir = src/c/matrixOperations/spec2 -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/includes/machine.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -libSpec2_la_LIBADD = -am__objects_1 = -am_libSpec2_la_OBJECTS = $(am__objects_1) libSpec2_la-sspec2a.lo \ - libSpec2_la-dspec2a.lo libSpec2_la-cspec2a.lo \ - libSpec2_la-zspec2a.lo -libSpec2_la_OBJECTS = $(am_libSpec2_la_OBJECTS) -libSpec2_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libSpec2_la_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am_testDoubleSpec2_OBJECTS = \ - testDoubleSpec2-testDoubleSpec2.$(OBJEXT) -testDoubleSpec2_OBJECTS = $(am_testDoubleSpec2_OBJECTS) -testDoubleSpec2_DEPENDENCIES = $(check_LDADD) -testDoubleSpec2_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testDoubleSpec2_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am_testFloatSpec2_OBJECTS = testFloatSpec2-testFloatSpec2.$(OBJEXT) -testFloatSpec2_OBJECTS = $(am_testFloatSpec2_OBJECTS) -testFloatSpec2_DEPENDENCIES = $(check_LDADD) -testFloatSpec2_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testFloatSpec2_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/includes -depcomp = $(SHELL) $(top_srcdir)/config/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(libSpec2_la_SOURCES) $(testDoubleSpec2_SOURCES) \ - $(testFloatSpec2_SOURCES) -DIST_SOURCES = $(libSpec2_la_SOURCES) $(testDoubleSpec2_SOURCES) \ - $(testFloatSpec2_SOURCES) -ETAGS = etags -CTAGS = ctags -am__tty_colors = \ -red=; grn=; lgn=; blu=; std= -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FGREP = @FGREP@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBMATH = @LIBMATH@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_ct_F77 = @ac_ct_F77@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -libSpec2_la_CFLAGS = -I $(top_builddir)/src/c/type \ - -I $(top_builddir)/src/c/matrixOperations/includes \ - -I $(top_builddir)/src/c/operations/includes \ - -I $(top_builddir)/src/c/elementaryFunctions/includes\ - -I $(top_builddir)/src/c/auxiliaryFunctions/includes - -instdir = $(top_builddir)/lib -pkglib_LTLIBRARIES = libSpec2.la -HEAD = ../includes/spec.h -libSpec2_la_SOURCES = $(HEAD) \ - sspec2a.c \ - dspec2a.c \ - cspec2a.c \ - zspec2a.c - -check_LDADD = $(top_builddir)/src/c/type/libDoubleComplex.la \ - $(top_builddir)/src/c/type/libFloatComplex.la \ - $(top_builddir)/src/c/elementaryFunctions/sqrt/libSqrt.la \ - $(top_builddir)/src/fortran/lapack/libscilapack.la \ - $(top_builddir)/src/fortran/blas/libsciblas.la \ - $(top_builddir)/src/c/auxiliaryFunctions/abs/libAbs.la \ - $(top_builddir)/src/c/auxiliaryFunctions/conj/libConj.la \ - $(top_builddir)/src/c/auxiliaryFunctions/sign/libSign.la \ - $(top_builddir)/src/c/auxiliaryFunctions/pythag/libPythag.la \ - $(top_builddir)/src/c/operations/addition/libAddition.la \ - $(top_builddir)/src/c/operations/multiplication/libMultiplication.la \ - $(top_builddir)/src/c/matrixOperations/inversion/libMatrixInversion.la\ - $(top_builddir)/src/c/matrixOperations/zeros/libMatrixZeros.la\ - libSpec2.la - -check_INCLUDES = -I $(top_builddir)/src/c/type \ - -I $(top_builddir)/src/c/matrixOperations/includes \ - -I $(top_builddir)/src/c/operations/includes \ - -I $(top_builddir)/src/c/elementaryFunctions/includes\ - -I $(top_builddir)/src/c/auxiliaryFunctions/includes - -testDoubleSpec2_SOURCES = testDoubleSpec2.c -testDoubleSpec2_LDADD = $(check_LDADD) -testDoubleSpec2_CFLAGS = $(check_INCLUDES) -testFloatSpec2_SOURCES = testFloatSpec2.c -testFloatSpec2_LDADD = $(check_LDADD) -testFloatSpec2_CFLAGS = $(check_INCLUDES) -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/c/matrixOperations/spec2/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/c/matrixOperations/spec2/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libSpec2.la: $(libSpec2_la_OBJECTS) $(libSpec2_la_DEPENDENCIES) - $(libSpec2_la_LINK) -rpath $(pkglibdir) $(libSpec2_la_OBJECTS) $(libSpec2_la_LIBADD) $(LIBS) - -clean-checkPROGRAMS: - @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list -testDoubleSpec2$(EXEEXT): $(testDoubleSpec2_OBJECTS) $(testDoubleSpec2_DEPENDENCIES) - @rm -f testDoubleSpec2$(EXEEXT) - $(testDoubleSpec2_LINK) $(testDoubleSpec2_OBJECTS) $(testDoubleSpec2_LDADD) $(LIBS) -testFloatSpec2$(EXEEXT): $(testFloatSpec2_OBJECTS) $(testFloatSpec2_DEPENDENCIES) - @rm -f testFloatSpec2$(EXEEXT) - $(testFloatSpec2_LINK) $(testFloatSpec2_OBJECTS) $(testFloatSpec2_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSpec2_la-cspec2a.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSpec2_la-dspec2a.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSpec2_la-sspec2a.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSpec2_la-zspec2a.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testDoubleSpec2-testDoubleSpec2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testFloatSpec2-testFloatSpec2.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -libSpec2_la-sspec2a.lo: sspec2a.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec2_la_CFLAGS) $(CFLAGS) -MT libSpec2_la-sspec2a.lo -MD -MP -MF $(DEPDIR)/libSpec2_la-sspec2a.Tpo -c -o libSpec2_la-sspec2a.lo `test -f 'sspec2a.c' || echo '$(srcdir)/'`sspec2a.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libSpec2_la-sspec2a.Tpo $(DEPDIR)/libSpec2_la-sspec2a.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sspec2a.c' object='libSpec2_la-sspec2a.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec2_la_CFLAGS) $(CFLAGS) -c -o libSpec2_la-sspec2a.lo `test -f 'sspec2a.c' || echo '$(srcdir)/'`sspec2a.c - -libSpec2_la-dspec2a.lo: dspec2a.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec2_la_CFLAGS) $(CFLAGS) -MT libSpec2_la-dspec2a.lo -MD -MP -MF $(DEPDIR)/libSpec2_la-dspec2a.Tpo -c -o libSpec2_la-dspec2a.lo `test -f 'dspec2a.c' || echo '$(srcdir)/'`dspec2a.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libSpec2_la-dspec2a.Tpo $(DEPDIR)/libSpec2_la-dspec2a.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dspec2a.c' object='libSpec2_la-dspec2a.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec2_la_CFLAGS) $(CFLAGS) -c -o libSpec2_la-dspec2a.lo `test -f 'dspec2a.c' || echo '$(srcdir)/'`dspec2a.c - -libSpec2_la-cspec2a.lo: cspec2a.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec2_la_CFLAGS) $(CFLAGS) -MT libSpec2_la-cspec2a.lo -MD -MP -MF $(DEPDIR)/libSpec2_la-cspec2a.Tpo -c -o libSpec2_la-cspec2a.lo `test -f 'cspec2a.c' || echo '$(srcdir)/'`cspec2a.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libSpec2_la-cspec2a.Tpo $(DEPDIR)/libSpec2_la-cspec2a.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cspec2a.c' object='libSpec2_la-cspec2a.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec2_la_CFLAGS) $(CFLAGS) -c -o libSpec2_la-cspec2a.lo `test -f 'cspec2a.c' || echo '$(srcdir)/'`cspec2a.c - -libSpec2_la-zspec2a.lo: zspec2a.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec2_la_CFLAGS) $(CFLAGS) -MT libSpec2_la-zspec2a.lo -MD -MP -MF $(DEPDIR)/libSpec2_la-zspec2a.Tpo -c -o libSpec2_la-zspec2a.lo `test -f 'zspec2a.c' || echo '$(srcdir)/'`zspec2a.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libSpec2_la-zspec2a.Tpo $(DEPDIR)/libSpec2_la-zspec2a.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zspec2a.c' object='libSpec2_la-zspec2a.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec2_la_CFLAGS) $(CFLAGS) -c -o libSpec2_la-zspec2a.lo `test -f 'zspec2a.c' || echo '$(srcdir)/'`zspec2a.c - -testDoubleSpec2-testDoubleSpec2.o: testDoubleSpec2.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSpec2_CFLAGS) $(CFLAGS) -MT testDoubleSpec2-testDoubleSpec2.o -MD -MP -MF $(DEPDIR)/testDoubleSpec2-testDoubleSpec2.Tpo -c -o testDoubleSpec2-testDoubleSpec2.o `test -f 'testDoubleSpec2.c' || echo '$(srcdir)/'`testDoubleSpec2.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/testDoubleSpec2-testDoubleSpec2.Tpo $(DEPDIR)/testDoubleSpec2-testDoubleSpec2.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleSpec2.c' object='testDoubleSpec2-testDoubleSpec2.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSpec2_CFLAGS) $(CFLAGS) -c -o testDoubleSpec2-testDoubleSpec2.o `test -f 'testDoubleSpec2.c' || echo '$(srcdir)/'`testDoubleSpec2.c - -testDoubleSpec2-testDoubleSpec2.obj: testDoubleSpec2.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSpec2_CFLAGS) $(CFLAGS) -MT testDoubleSpec2-testDoubleSpec2.obj -MD -MP -MF $(DEPDIR)/testDoubleSpec2-testDoubleSpec2.Tpo -c -o testDoubleSpec2-testDoubleSpec2.obj `if test -f 'testDoubleSpec2.c'; then $(CYGPATH_W) 'testDoubleSpec2.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleSpec2.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/testDoubleSpec2-testDoubleSpec2.Tpo $(DEPDIR)/testDoubleSpec2-testDoubleSpec2.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleSpec2.c' object='testDoubleSpec2-testDoubleSpec2.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSpec2_CFLAGS) $(CFLAGS) -c -o testDoubleSpec2-testDoubleSpec2.obj `if test -f 'testDoubleSpec2.c'; then $(CYGPATH_W) 'testDoubleSpec2.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleSpec2.c'; fi` - -testFloatSpec2-testFloatSpec2.o: testFloatSpec2.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSpec2_CFLAGS) $(CFLAGS) -MT testFloatSpec2-testFloatSpec2.o -MD -MP -MF $(DEPDIR)/testFloatSpec2-testFloatSpec2.Tpo -c -o testFloatSpec2-testFloatSpec2.o `test -f 'testFloatSpec2.c' || echo '$(srcdir)/'`testFloatSpec2.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/testFloatSpec2-testFloatSpec2.Tpo $(DEPDIR)/testFloatSpec2-testFloatSpec2.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatSpec2.c' object='testFloatSpec2-testFloatSpec2.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSpec2_CFLAGS) $(CFLAGS) -c -o testFloatSpec2-testFloatSpec2.o `test -f 'testFloatSpec2.c' || echo '$(srcdir)/'`testFloatSpec2.c - -testFloatSpec2-testFloatSpec2.obj: testFloatSpec2.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSpec2_CFLAGS) $(CFLAGS) -MT testFloatSpec2-testFloatSpec2.obj -MD -MP -MF $(DEPDIR)/testFloatSpec2-testFloatSpec2.Tpo -c -o testFloatSpec2-testFloatSpec2.obj `if test -f 'testFloatSpec2.c'; then $(CYGPATH_W) 'testFloatSpec2.c'; else $(CYGPATH_W) '$(srcdir)/testFloatSpec2.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/testFloatSpec2-testFloatSpec2.Tpo $(DEPDIR)/testFloatSpec2-testFloatSpec2.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatSpec2.c' object='testFloatSpec2-testFloatSpec2.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSpec2_CFLAGS) $(CFLAGS) -c -o testFloatSpec2-testFloatSpec2.obj `if test -f 'testFloatSpec2.c'; then $(CYGPATH_W) 'testFloatSpec2.c'; else $(CYGPATH_W) '$(srcdir)/testFloatSpec2.c'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; skip=0; \ - srcdir=$(srcdir); export srcdir; \ - list=' $(TESTS) '; \ - $(am__tty_colors); \ - if test -n "$$list"; then \ - for tst in $$list; do \ - if test -f ./$$tst; then dir=./; \ - elif test -f $$tst; then dir=; \ - else dir="$(srcdir)/"; fi; \ - if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$tst[\ \ ]*) \ - xpass=`expr $$xpass + 1`; \ - failed=`expr $$failed + 1`; \ - col=$$red; res=XPASS; \ - ;; \ - *) \ - col=$$grn; res=PASS; \ - ;; \ - esac; \ - elif test $$? -ne 77; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$tst[\ \ ]*) \ - xfail=`expr $$xfail + 1`; \ - col=$$lgn; res=XFAIL; \ - ;; \ - *) \ - failed=`expr $$failed + 1`; \ - col=$$red; res=FAIL; \ - ;; \ - esac; \ - else \ - skip=`expr $$skip + 1`; \ - col=$$blu; res=SKIP; \ - fi; \ - echo "$${col}$$res$${std}: $$tst"; \ - done; \ - if test "$$all" -eq 1; then \ - tests="test"; \ - All=""; \ - else \ - tests="tests"; \ - All="All "; \ - fi; \ - if test "$$failed" -eq 0; then \ - if test "$$xfail" -eq 0; then \ - banner="$$All$$all $$tests passed"; \ - else \ - if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ - banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ - fi; \ - else \ - if test "$$xpass" -eq 0; then \ - banner="$$failed of $$all $$tests failed"; \ - else \ - if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ - banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ - fi; \ - fi; \ - dashes="$$banner"; \ - skipped=""; \ - if test "$$skip" -ne 0; then \ - if test "$$skip" -eq 1; then \ - skipped="($$skip test was not run)"; \ - else \ - skipped="($$skip tests were not run)"; \ - fi; \ - test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$skipped"; \ - fi; \ - report=""; \ - if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ - report="Please report to $(PACKAGE_BUGREPORT)"; \ - test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$report"; \ - fi; \ - dashes=`echo "$$dashes" | sed s/./=/g`; \ - if test "$$failed" -eq 0; then \ - echo "$$grn$$dashes"; \ - else \ - echo "$$red$$dashes"; \ - fi; \ - echo "$$banner"; \ - test -z "$$skipped" || echo "$$skipped"; \ - test -z "$$report" || echo "$$report"; \ - echo "$$dashes$$std"; \ - test "$$failed" -eq 0; \ - else :; fi - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) - $(MAKE) $(AM_MAKEFLAGS) check-TESTS -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ - clean-pkglibLTLIBRARIES mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: check-am install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ - clean-checkPROGRAMS clean-generic clean-libtool \ - clean-pkglibLTLIBRARIES ctags distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-pkglibLTLIBRARIES install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/c/matrixOperations/spec2/cspec2a.c b/src/c/matrixOperations/spec2/cspec2a.c deleted file mode 100644 index d3a4312..0000000 --- a/src/c/matrixOperations/spec2/cspec2a.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ - -#include <stdlib.h> -#include "spec.h" - - - -void cspec2a(floatComplex* in, int rows, floatComplex* eigenvalues,floatComplex* eigenvectors){ - /* As we use Lapack to find the eigenvalues, we must cast the floatComplex input into doubleComplex - and the doubleComplex outputs of dspeca into floatComplex*/ - - int i; - doubleComplex* dblin; - doubleComplex* dbleigenvalues,*dbleigenvectors; - - dblin=(doubleComplex*)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); - dbleigenvalues=(doubleComplex*)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); - dbleigenvectors=(doubleComplex*)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); - - for (i=0;i<rows*rows;i++) dblin[i]=DoubleComplex((double)creals(in[i]),(double)cimags(in[i])); - - zspec2a(dblin,rows,dbleigenvalues,dbleigenvectors); - - for (i=0;i<rows*rows;i++) eigenvalues[i]=FloatComplex((float)zreals(dbleigenvalues[i]),(float)zimags(dbleigenvalues[i])); - for (i=0;i<rows*rows;i++) eigenvectors[i]=FloatComplex((float)zreals(dbleigenvectors[i]),(float)zimags(dbleigenvectors[i])); -} diff --git a/src/c/matrixOperations/spec2/dspec2a.c b/src/c/matrixOperations/spec2/dspec2a.c deleted file mode 100644 index 98b2c5a..0000000 --- a/src/c/matrixOperations/spec2/dspec2a.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ - -#include <stdlib.h> -#include "spec.h" -#include "lapack.h" -#include "zeros.h" -#include "max.h" - -void dspec2a(double* in, int rows,double* eigenvalues,double* eigenvectors){ - int i=0, j=0, ij=0, ij1=0; - int symmetric=0; - int INFO=0; - int iWorkSize = 0; - double* pdblWork; - double* outReal; - double* outImag; - double* pdblLeftvectors; - double* pdblRightvectors; - double* inCopy; - - /* FIXME : malloc here */ - inCopy = (double*)malloc((unsigned int)(rows*rows) * sizeof(double)); - outReal = (double*)malloc((unsigned int)rows * sizeof(double)); - outImag = NULL; - pdblLeftvectors=NULL; - pdblRightvectors=NULL; - - - iWorkSize = 4*rows; - pdblWork = (double*)malloc((unsigned int)iWorkSize * sizeof(double)); - - for(i=0;i<rows*rows;i++) inCopy[i]=in[i]; - - - - /* look if the matrix is symmetric */ - for (i=0;i<rows;i++){ - for (j=0;j<rows;j++) - if (in[i*rows+j]!=in[i+j*rows]) break; - if (j!=rows) break; - - } - - /* the matrix is symmetric if the 2 loops goes to end i.e - i==rows and j==rows */ - if ((i==rows)&&(j==rows)) symmetric=1; - - /* apply lapack function according to symmetry */ - if(symmetric){ - C2F(dsyev)( "V", "U", &rows, inCopy, &rows, outReal, pdblWork, &iWorkSize, &INFO ); - - /* Computation of eigenvectors */ - for (i=0;i<rows*rows;i++) eigenvectors[i] = inCopy[i]; - } - else { - pdblRightvectors=(double*)malloc((unsigned int)(rows*rows) * sizeof(double)); - outImag = (double*)malloc((unsigned int)rows * sizeof(double)); - C2F(dgeev)( "N", "V", &rows, inCopy, &rows, outReal, outImag, - pdblLeftvectors, &rows, pdblRightvectors, &rows, pdblWork, &iWorkSize, &INFO ); - - /* Computation of eigenvectors */ - j=0; - while (j<rows) - { - if (outImag[j]==0) - { - for(i = 0 ; i < rows ; i++) - { - ij = i + j * rows; - eigenvectors[ij] = pdblRightvectors[ij]; - } - j = j + 1; - } - else - { - for(i = 0 ; i < rows ; i++) - { - ij = i + j * rows; - ij1 = i + (j + 1) * rows; - eigenvectors[ij] = pdblRightvectors[ij]; - eigenvectors[ij1] = pdblRightvectors[ij]; - } - j = j + 2; - } - } - } - - /* Computation of eigenvalues */ - dzerosa(eigenvalues,1,rows*rows); - for (i=0;i<rows;i++) eigenvalues[i+i*rows]=outReal[i]; - - - - - free(inCopy); - free(outReal); - free(outImag); - free(pdblLeftvectors); - free(pdblRightvectors); - free(pdblWork); - -} - diff --git a/src/c/matrixOperations/spec2/sspec2a.c b/src/c/matrixOperations/spec2/sspec2a.c deleted file mode 100644 index d3ab00d..0000000 --- a/src/c/matrixOperations/spec2/sspec2a.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ - -#include <stdlib.h> -#include "spec.h" - - - -void sspec2a(float* in, int rows, float* eigenvalues,float* eigenvectors){ - /* As we use Lapack to find the eigenvalues, we must cast the float input into double - and the doubleComplex outputs of dspec2a into floatComplex*/ - - int i; - double* dblin; - double *dbleigenvalues,*dbleigenvectors; - - dblin=(double*)malloc((unsigned int)(rows*rows)*sizeof(double)); - dbleigenvalues = (double*)malloc((unsigned int)(rows*rows)*sizeof(double)); - dbleigenvectors = (double*)malloc((unsigned int)(rows*rows)*sizeof(double)); - - for (i=0;i<rows*rows;i++) dblin[i]=(double)in[i]; - - dspec2a(dblin,rows,dbleigenvalues,dbleigenvectors); - - for (i=0;i<rows*rows;i++) eigenvalues[i]=(float)dbleigenvalues[i]; - for (i=0;i<rows*rows;i++) eigenvectors[i]=(float)dbleigenvectors[i]; -} diff --git a/src/c/matrixOperations/spec2/testDoubleSpec2.c b/src/c/matrixOperations/spec2/testDoubleSpec2.c deleted file mode 100644 index a090f02..0000000 --- a/src/c/matrixOperations/spec2/testDoubleSpec2.c +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ - - -#include "spec.h" -#include "stdio.h" -#include "assert.h" -#include "math.h" - -static void dspec2aTest(void){ - double in[4]={1,1,1,3}; - double resultValuesR[4]={0.5857864376269050765700,0,0,3.4142135623730949234300}; - double resultVectorsR[4]={- 0.9238795325112867384831,0.3826834323650897817792, - 0.3826834323650897817792,0.9238795325112867384831}; - - - double in2[4]={1,1,-2,3}; - double resultValues2R[4]={1.9999999999999997779554,0,0,1.9999999999999997779554}; - double resultVectors2R[4]={0.8164965809277261454824,- 0.4082482904638631282523, - 0.8164965809277261454824,- 0.4082482904638631282523}; - - double in3[9]={0,-1,0,1,0,0,0,0,0}; - double resultValues3R[9]={0}; - double resultVectors3R[9]={0.7071067811865474617150,0,0,0.7071067811865474617150,0,0,0,0,1}; - - - double out1[4],out2[4],out3[9],out4[9]; - - int i; - dspec2a(in3,3,out3,out4); - for(i=0;i<9;i++){ - if (out3[i]>1e-16) assert( fabs(out3[i]-resultValues3R[i]) / fabs(out3[i]) <3e-16); - else assert(1); - } - for(i=0;i<9;i++){ - if (out4[i]>1e-16) assert( fabs(out4[i]-resultVectors3R[i]) / fabs(out4[i]) <3e-16); - else assert(1); - } - - - dspec2a(in,2,out1,out2); - for(i=0;i<4;i++) printf("%f\n",out1[i]); - for(i=0;i<4;i++){ - if (out1[i]>1e-16) assert( fabs(out1[i]-resultValuesR[i]) / fabs(out1[i]) <3e-16); - else assert(1); - } - for(i=0;i<4;i++){ - if (out2[i]>1e-16) assert( fabs(out2[i]-resultVectorsR[i]) / fabs(out2[i]) <3e-16); - else assert(1); - } - - - dspec2a(in2,2,out1,out2); - - for(i=0;i<4;i++){ - if (out1[i]>1e-16) assert( fabs(out1[i]-resultValues2R[i]) / fabs(out1[i]) <1e-16); - else assert(1); - } - for(i=0;i<4;i++){ - if (out2[i]>1e-16) assert( fabs(out2[i]-resultVectors2R[i]) / fabs(out2[i]) <3e-16); - else assert(1); - } - -} - - - - -static void zspec2aTest(void){ - double inR[4]={1,1,1,3}; - double inI[4]={0,0,0,0}; - double resultValuesR[4]={0.5857864376269050765700,0,0,3.4142135623730949234300}; - double resultValuesI[4]={0,0,0,0}; - double resultVectorsR[4]={- 0.9238795325112867384831,0.3826834323650897817792, - 0.3826834323650897817792,0.9238795325112867384831}; - double resultVectorsI[4]={0,0,0,0}; - - double in2R[4]={1,1,-2,3}; - double in2I[4]={0,0,0,0}; - double resultValues2R[4]={1.9999999999999997779554,0,0,1.9999999999999997779554}; - double resultValues2I[4]={0.9999999999999997779554,0,0,-0.9999999999999997779554}; - double resultVectors2R[4]={0.8164965809277261454824,- 0.4082482904638631282523, - 0.8164965809277261454824,- 0.4082482904638631282523}; - double resultVectors2I[4]={0,- 0.4082482904638629062077,0,0.4082482904638629062077}; - - - double in3R[16]={ 0.4685934986919164657593, 0.4262020816095173358917, 0.4217656338587403297424, 0.1034853602759540081024 , - 0.4279759414494037628174, 0.7860729382373392581940, 0.8568082069978117942810, 0.1993437460623681545258 , - 0.7131301630288362503052, 0.5208952468819916248322, 0.9311723159626126289368, 0.4143836158327758312225, - 0.5980196148157119750977, 0.5549105503596365451813, 0.8552952585741877555847, 0.3097750707529485225678}; - double in3I[16]={0.9446128141134977340698, 0.2442680452950298786163, 0.8760446915403008460999, 0.4874215493910014629364, - 0.3844018988311290740967, 0.0922345430590212345123, 0.0705418726429343223572, 0.7338807261548936367035, - 0.7792180571705102920532, 0.7827638057060539722443, 0.2161567779257893562317, 0.3420197847299277782440, - 0.430093832314014434814 , 0.6261752569116652011871, 0.9554250938817858695984, 0.45415506651625037193 }; - double resultValues3R[16]={2.0556597713281337114211 , 0. , 0. , 0. , - 0. , - 0.3025728286579054682193 , 0. , 0. , - 0. , 0. , 0.1432776981289703988054 , 0. , - 0. , 0. , 0. , 0.59924918284561956571821}; - double resultValues3I[16]={2.0772175543447914947137 , 0. , 0. , 0. , - 0. , - 0.5223086999196728807959 , 0. , 0. , - 0. , 0. , 0.3871735516160564882782 , 0. , - 0. , 0. , 0. , - 0.2349232044266161556489 }; - double resultVectors3R[16]={ 0.5762578366606958546470 , 0.4529873647084416976583 , 0.5438116534400605495137 , 0.3599855200589946457868 , - - 0.3285074902800487195442, - 0.0923654569732548225147, 0.6473744750124794666846, - 0.1812302216765642182139 , - 0.7395301236826927748780, - 0.4588526195219964631811, 0.0997916953568371567496, - 0.3603263850824164338249 , - 0.0717862182160008133192, 0.6967198304315765922112, - 0.1153149977500917411355 , - 0.3232658081022470875077 }; - double resultVectors3I[16]={ 0. , - 0.1082260232744242933745, - 0.1403164362264210929254 , 0.0775054168635924967123 , - 0.0347047096401541868560, - 0.4780157518240965019984, 0. , 0.4493438228998393735303, - 0. , - 0.0484367977162360741072 , 0.0664282497469102783949 , - 0.3098340648435350952461 , - 0.1768623397230159322024, 0. , - 0.4621680558325051979551 , 0.3830799998945915163517}; - - - double in4R[49]={0.0292230211198329925537, 0.1069206790998578071594, 9.7463708464056253433228, 7.7042609406635165214539 , 6.3966313377022743225098, 9.5358861843124032020569, 4.1484833415597677230835, - 4.6615396952256560325623, 2.2384551353752613067627, 3.4569733263924717903137, 2.3406236339360475540161, 6.6193414805456995964050,2.6911795139312744140625,9.8302489006891846656799 , - 7.3933512251824140548706, 2.9021358629688620567322 , 3.9959496073424816131592 , 9.792278115637600421906 , 0.0755135808140039443970, 7.0210226578637957572937 , 8.9075061306357383728027 , - 6.5269742021337151527405 , 4.136228552088141441345 , 8.5816909139975905418396 , 2.3960896767675876617432 , 4.8200417729094624519348, 9.848585547879338264465 , 4.4697216479107737541199, - 2.3298137634992599487305, 2.2345139319077134132385, 8.0025654565542936325073, 7.7507343282923102378845, 4.8250066302716732025146, 7.8448831336572766304016 , 1.5346793178468942642212 , - 7.7228771103546023368835 , 8.9520217850804328918457, 9.4673257926478981971741, 6.9818257447332143783569, 9.5591608202084898948669, 0.4840173013508319854736, 5.3235206427052617073059, - 2.9468670953065156936646, 6.9771366892382502555847 , 9.3762038648128509521484 , 1.0755608463659882545471 , 7.7634243946522474288940, 6.3734178384765982627869 , 0.6630615703761577606201 }; - double in4I[49]={8.1694598542526364326477, 3.5473910067230463027954, 5.860544512979686260223, 3.4610254690051078796387, 4.4247510144487023353577, 8.8226650562137365341187, 7.6436930662021040916443 , - 7.764139864593744277954, 2.8076809318736195564270, 6.9086006004363298416138, 7.1747286943718791007996, 3.7201813608407974243164 , 9.3254965776577591896057, 2.2566775511950254440308, - 7.5211019208654761314392 , 3.0747506581246852874756 , 5.9793261485174298286438, 1.9238903466612100601196, 2.3870888305827975273132 , 7.4708331003785133361816, 9.7131536761298775672913, - 4.3703553732484579086304, 6.2248750543221831321716, 3.2913279719650745391846, 3.2963873865082859992981, 2.7686371374875307083130 , 4.8729835031554102897644, 7.7320465445518493652344 , - 9.0775218093767762184143, 5.0122931879013776779175, 5.1595458528026938438416, 5.79267887398600578308 , 1.5463936375454068183899 , 7.6111377868801355361938, 6.9079177780076861381531 , - 2.8732293471693992614746, 9.64253133628517389297 , 5.6607243325561285018921, 5.7821379369124770164490, 2.6634209789335727691650 , 4.7470985027030110359192, 6.0735465306788682937622, - 0.4097307054325938224793, 5.0125684589147567749023 , 5.2959309751167893409729, 6.2594583164900541305542, 2.2193526616320013999939 , 3.467419948428869247437, 3.9511676924303174018860 }; - double resultValues4R[49]={39.018457752476393807228 ,0,0,0,0,0,0, - 0,2.2455352415739073812517,0,0,0,0,0, - 0,0,- 8.4848591657394489828903,0,0,0,0, - 0,0,0,- 9.617033196016185669919,0,0,0, - 0,0,0,0,- 3.7815852014367528077798,0,0, - 0,0,0,0,0,- 4.44858427601393291440,0, - 0,0,0,0,0,0,- 0.3001282122401837670900}; - double resultValues4I[49]={36.525725390582877594170,0,0,0,0,0,0, - 0,- 5.9058762755733944516123,0,0,0,0,0, - 0,0,- 3.5959527108686115681735,0,0,0,0, - 0,0,0,1.8928051444081777088257,0,0,0, - 0,0,0,0,- 3.1889864758923365251064,0,0, - 0,0,0,0,0,3.2418188738592150777151,0, - 0,0,0,0,0,0,1.5279802073147508156836}; - - double resultVectors4R[49]={ 0.3499995148567048852684, 0.3131141942665225941234, 0.4518966551544936205431, 0.3429358568207974133912, 0.3073919828504245721490, 0.4236868694783915145763, 0.3928739146959387973368 , - 0.2654822689469810148566 , - 0.3607918093136298631762, 0.0473515544359270068586 , 0.5097969509656486986060 , -0.3771134435310480315096 , 0.2011534205484152293408, - 0.4415200724898113993078, - 0.5454886553461798515130, - 0.2173248800239625522224, - 0.2171708216301463378883 , - 0.2460117034233289534662 , -0.3694743444265859433351 , 0.3601018742104445391483, 0.1530612374027510713681, - 0.6385835932752577104310, - 0.0013906755423099548263, - 0.3368505708673739662551 , 0.1394203608831885433 , -0.2292783363046769218308 , -0.2740379414191142504187, 0.1926279946047058377889 , - - 0.6106238336849327819067, 0.0128604884735820379493, 0.2248434453925002574071, - 0.0955950290268089419854 , 0.6322383898844411431739 , - 0.1362122761803175874373, - 0.0030545591332723984190, - 0.5431360047322275619308, 0.1304324282476526930541, - 0.3713242513274904177401, - 0.2693820083406764376299 , - 0.1431429883314006001882 , 0.0533021313694299267438, 0.0071247423818797811501 , - - 0.156705245229635081738, 0.0034676864415526253982 , - 0.3351413975178426096768 , 0.2927797449896782921996 , 0.5714932440406852443005 , 0.0738366305178744797288, - 0.4509415569247051669422 }; - double resultVectors4I[49]={ 0.0720991445669864616796 , 0.0844739028302603361942 , 0. , 0.0173431366502564965337, -0.0428710162141596462515, 0.0695226101295536302871, 0.0999385617869267273150, - 0.2510960793336660668018 , - 0.1123901435582568414384, 0.0091069807153507792430, 0. , - 0.2545493692188907641771, 0.1149714203529902251111, 0.0762796210842419941667, - 0. , 0.0611827470444509316505, 0.2295643426501567385678, - 0.2950878328821502361024, 0.198556748820033573955, 0.0646801132828138114483, - 0.2660572521172601678785, - 0. , 0.2688905463703794573860, 0.2230635356255223633593 , - 0.2013432448241845862391, - 0.0386922946770884290668, 0.0358963301038670995480, - 0.3593711366897305303780 , - - 0.1386717901043315326337, 0.0600994116374372472356, - 0.1167558596038882207102 , 0.317965599565130263571, 0. , -0.0642522754144960878131, - 0.0853665514099945371695, - 0. , 0.2715431731544318272320, - 0.1184277560110737481658 , 0.3655618467608299226868, - 0.4598766797780974302512 , 0.0188698345957667955319, - 0.1446429340244405892246, - 0.346095581161616094867 , 0.0750882555805542639682, - 0.2494867985551498246188, - 0.2328934592128872882455, 0. , -0.0047307828167728396829, - 0.0078254955461786041004}; - - - - - doubleComplex *in,*in2,*in3,*in4,out1[4],out2[4],out3[16],out4[16],out5[49],out6[49]; - - int i; - - in=DoubleComplexMatrix(inR,inI,4); - in2=DoubleComplexMatrix(in2R,in2I,4); - in3=DoubleComplexMatrix(in3R,in3I,16); - in4=DoubleComplexMatrix(in4R,in4I,49); - zspec2a(in,2,out1,out2); - - - for(i=0;i<4;i++){ - if (zreals(out1[i])>1e-16) assert( fabs(zreals(out1[i])-resultValuesR[i]) / fabs(zreals(out1[i])) <3e-16); - else assert(1); - if (zimags(out1[i])>1e-16) assert( fabs(zimags(out1[i])-resultValuesI[i]) / fabs(zimags(out1[i])) <1e-16); - else assert(1); - } - - for(i=0;i<4;i++){ - if (zreals(out2[i])>1e-16) assert( fabs(zreals(out2[i])-resultVectorsR[i]) / fabs(zreals(out2[i])) <3e-16); - else assert(1); - if (zimags(out2[i])>1e-16) assert( fabs(zimags(out2[i])-resultVectorsI[i]) / fabs(zimags(out2[i])) <1e-16); - else assert(1); - } - - - zspec2a(in2,2,out1,out2); - for(i=0;i<4;i++){ - if (zreals(out1[i])>1e-16) assert( fabs(zreals(out1[i])-resultValues2R[i]) / fabs(zreals(out1[i])) <3e-16); - else assert(1); - if (zimags(out1[i])>1e-16) assert( fabs(zimags(out1[i])-resultValues2I[i]) / fabs(zimags(out1[i])) <3e-15); - else assert(1); - } - - for(i=0;i<4;i++){ - if (zreals(out2[i])>1e-16) assert( fabs(zreals(out2[i])-resultVectors2R[i]) / fabs(zreals(out2[i])) <3e-16); - else assert(1); - if (zimags(out2[i])>1e-16) assert( fabs(zimags(out2[i])-resultVectors2I[i]) / fabs(zimags(out2[i])) <3e-15); - else assert(1); - } - - - - zspec2a(in3,4,out3,out4); - for(i=0;i<16;i++){ - if (zreals(out3[i])>1e-16) assert( fabs(zreals(out3[i])-resultValues3R[i]) / fabs(zreals(out3[i])) <3e-15); - else assert(1); - if (zimags(out3[i])>1e-16) assert( fabs(zimags(out3[i])-resultValues3I[i]) / fabs(zimags(out3[i])) <3e-15); - else assert(1); - } - for(i=0;i<16;i++){ - if (zreals(out4[i])>1e-16) assert( fabs(zreals(out4[i])-resultVectors3R[i]) / fabs(zreals(out4[i])) <3e-15); - else assert(1); - if (zimags(out4[i])>1e-16) assert( fabs(zimags(out4[i])-resultVectors3I[i]) / fabs(zimags(out4[i])) <3e-14); - else assert(1); - } - - /* FIXME : assert : 3e-16 maybe du to little values like 0.001... */ - zspec2a(in4,7,out5,out6); - - for(i=0;i<49;i++){ - if (zreals(out5[i])>1e-16) assert( fabs(zreals(out5[i])-resultValues4R[i]) / fabs(zreals(out5[i])) <3e-15); - else assert(1); - if (zimags(out5[i])>1e-16) assert( fabs(zimags(out5[i])-resultValues4I[i]) / fabs(zimags(out5[i])) <3e-14); - else assert(1); - } - for(i=0;i<49;i++){ - if (zreals(out6[i])>1e-16) assert( fabs(zreals(out6[i])-resultVectors4R[i]) / fabs(zreals(out6[i])) <3e-14); - else assert(1); - if (zimags(out6[i])>1e-16) assert( fabs(zimags(out6[i])-resultVectors4I[i]) / fabs(zimags(out6[i])) <3e-13); - else assert(1); - } - - - -} - - -static int testSpec2(void){ - printf(">>> Double Spec2 Tests <<<\n"); - printf(">>> Double <<<\n"); - dspec2aTest(); - printf(">>> DoubleComplex <<<\n"); - zspec2aTest(); - return 0; -} - - -int main(void){ - assert (testSpec2()==0); - - - return 0; -} diff --git a/src/c/matrixOperations/spec2/testFloatSpec2.c b/src/c/matrixOperations/spec2/testFloatSpec2.c deleted file mode 100644 index fb2bc25..0000000 --- a/src/c/matrixOperations/spec2/testFloatSpec2.c +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ - - -#include "spec.h" -#include "stdio.h" -#include "assert.h" -#include "math.h" - -static void sspec2aTest(void){ - float in[4]={1.0f,1.0f,1.0f,3.0f}; - float resultValuesR[4]={0.5857864376269050765700f,0,0,3.4142135623730949234300f}; - float resultVectorsR[4]={- 0.9238795325112867384831f,0.3826834323650897817792f, - 0.3826834323650897817792f,0.9238795325112867384831f}; - - float in2[4]={1.0f,1.0f,-2.0f,3.0f}; - float resultValues2R[4]={1.9999999999999997779554f,0,0,1.9999999999999997779554f}; - float resultVectors2R[4]={0.8164965809277261454824f,- 0.4082482904638631282523f, - 0.8164965809277261454824f,- 0.4082482904638631282523f}; - float eigenvalues[4],eigenvectors[4]; - - int i; - - sspec2a(in,2,eigenvalues,eigenvectors); - - for(i=0;i<4;i++){ - if (eigenvalues[i]>1e-6) assert( fabs(eigenvalues[i]-resultValuesR[i]) / fabs(eigenvalues[i]) <1e-16); - else assert(1); - } - for(i=0;i<4;i++){ - if (eigenvectors[i]>1e-6) assert( fabs(eigenvectors[i]-resultVectorsR[i]) / fabs(eigenvectors[i]) <1e-16); - else assert(1); - } - - - sspec2a(in2,2,eigenvalues,eigenvectors); - - - - for(i=0;i<4;i++){ - if (eigenvalues[i]>1e-6) assert( fabs(eigenvalues[i]-resultValues2R[i]) / fabs(eigenvalues[i]) <1e-16); - else assert(1); - } - for(i=0;i<4;i++){ - if (eigenvectors[i]>1e-6) assert( fabs(eigenvectors[i]-resultVectors2R[i]) / fabs(eigenvectors[i]) <1e-16); - else assert(1); - } -} - - - - -static void cspec2aTest(void){ - float inR[4]={1.0f,1.0f,1.0f,3.0f}; - float inI[4]={0.0f,0.0f,0.0f,0.0f}; - float resultValuesR[4]={0.5857864376269050765700f,0,0,3.4142135623730949234300f}; - float resultValuesI[4]={0,0,0,0}; - float resultVectorsR[4]={- 0.9238795325112867384831f,0.3826834323650897817792f, - 0.3826834323650897817792f,0.9238795325112867384831f}; - float resultVectorsI[4]={0,0,0,0}; - - float in2R[4]={1.0f,1.0f,-2.0f,3.0f}; - float in2I[4]={0.0f,0.0f,0.0f,0.0f}; - float resultValues2R[4]={1.9999999999999997779554f,0,0,1.9999999999999997779554f}; - float resultValues2I[4]={0.9999999999999997779554f,0,0,-0.9999999999999997779554f}; - float resultVectors2R[4]={0.8164965809277261454824f,- 0.4082482904638631282523f, - 0.8164965809277261454824f,- 0.4082482904638631282523f}; - float resultVectors2I[4]={0,- 0.4082482904638629062077f,0,0.4082482904638629062077f}; - - floatComplex *in,*in2,out1[4],out2[4]; - - int i; - - in=FloatComplexMatrix(inR,inI,4); - in2=FloatComplexMatrix(in2R,in2I,4); - - cspec2a(in,2,out1,out2); - for(i=0;i<4;i++){ - if (creals(out1[i])>1e-16) assert( fabs(creals(out1[i])-resultValuesR[i]) / fabs(creals(out1[i])) <1e-15); - else assert(1); - if (cimags(out1[i])>1e-16) assert( fabs(cimags(out1[i])-resultValuesI[i]) / fabs(cimags(out1[i])) <1e-16); - else assert(1); - } - for(i=0;i<4;i++){ - if (creals(out2[i])>1e-16) assert( fabs(creals(out2[i])-resultVectorsR[i]) / fabs(creals(out2[i])) <1e-15); - else assert(1); - if (cimags(out2[i])>1e-16) assert( fabs(cimags(out2[i])-resultVectorsI[i]) / fabs(cimags(out2[i])) <1e-16); - else assert(1); - } - - - cspec2a(in2,2,out1,out2); - for(i=0;i<4;i++){ - if (creals(out1[i])>1e-16) assert( fabs(creals(out1[i])-resultValues2R[i]) / fabs(creals(out1[i])) <1e-15); - else assert(1); - if (cimags(out1[i])>1e-16) assert( fabs(cimags(out1[i])-resultValues2I[i]) / fabs(cimags(out1[i])) <1e-15); - else assert(1); - } - for(i=0;i<4;i++){ - if (creals(out2[i])>1e-16) assert( fabs(creals(out2[i])-resultVectors2R[i]) / fabs(creals(out2[i])) <1e-15); - else assert(1); - if (cimags(out2[i])>1e-16) assert( fabs(cimags(out2[i])-resultVectors2I[i]) / fabs(cimags(out2[i])) <1e-16); - else assert(1); - } -} - - - - -static int testSpec2(void){ - printf(">>> Float Spec2 Tests <<<\n"); - printf(">>> Float <<<\n"); - sspec2aTest(); - printf(">>> FloatComplex <<<\n"); - cspec2aTest(); - return 0; -} - - -int main(void){ - assert (testSpec2()==0); - - - return 0; -} diff --git a/src/c/matrixOperations/spec2/test_DoubleSpec2/testDoubleSpec2.vcxproj b/src/c/matrixOperations/spec2/test_DoubleSpec2/testDoubleSpec2.vcxproj deleted file mode 100644 index 7c36943..0000000 --- a/src/c/matrixOperations/spec2/test_DoubleSpec2/testDoubleSpec2.vcxproj +++ /dev/null @@ -1,178 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{FD0A4495-C372-41EF-B8EF-0A0939DA6C1E}</ProjectGuid>
- <RootNamespace>testDoubleSpec2</RootNamespace>
- <Keyword>Win32Proj</Keyword>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="..\testDoubleSpec2.c">
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\..\type\type.vcxproj">
- <Project>{9b1bd750-1fef-4d6b-9422-782d16181cee}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- <ProjectReference Include="..\..\matrixOperations.vcxproj">
- <Project>{fd335544-52bf-4736-a34e-77f591d158d5}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file diff --git a/src/c/matrixOperations/spec2/test_DoubleSpec2/testDoubleSpec2.vcxproj.filters b/src/c/matrixOperations/spec2/test_DoubleSpec2/testDoubleSpec2.vcxproj.filters deleted file mode 100644 index 04f409d..0000000 --- a/src/c/matrixOperations/spec2/test_DoubleSpec2/testDoubleSpec2.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\testDoubleSpec2.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
-</Project>
\ No newline at end of file diff --git a/src/c/matrixOperations/spec2/test_FloatSpec2/testFloatSpec2.vcxproj b/src/c/matrixOperations/spec2/test_FloatSpec2/testFloatSpec2.vcxproj deleted file mode 100644 index f4154eb..0000000 --- a/src/c/matrixOperations/spec2/test_FloatSpec2/testFloatSpec2.vcxproj +++ /dev/null @@ -1,178 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{E20D0BC2-B28A-412C-9715-5B93B319A4A3}</ProjectGuid>
- <RootNamespace>testFloatSpec2</RootNamespace>
- <Keyword>Win32Proj</Keyword>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="..\testFloatSpec2.c">
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\..\type\type.vcxproj">
- <Project>{9b1bd750-1fef-4d6b-9422-782d16181cee}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- <ProjectReference Include="..\..\matrixOperations.vcxproj">
- <Project>{fd335544-52bf-4736-a34e-77f591d158d5}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file diff --git a/src/c/matrixOperations/spec2/test_FloatSpec2/testFloatSpec2.vcxproj.filters b/src/c/matrixOperations/spec2/test_FloatSpec2/testFloatSpec2.vcxproj.filters deleted file mode 100644 index 0c38d2f..0000000 --- a/src/c/matrixOperations/spec2/test_FloatSpec2/testFloatSpec2.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\testFloatSpec2.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
-</Project>
\ No newline at end of file diff --git a/src/c/matrixOperations/spec2/zspec2a.c b/src/c/matrixOperations/spec2/zspec2a.c deleted file mode 100644 index e33ed89..0000000 --- a/src/c/matrixOperations/spec2/zspec2a.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ - -#include <stdlib.h> -#include "spec.h" -#include "lapack.h" -#include "zeros.h" -#include "stdio.h" -#include "conj.h" - -void zspec2a(doubleComplex* in, int rows,doubleComplex* eigenvalues, doubleComplex* eigenvectors){ - int i = 0, j = 0; - int hermitian = 0; - int INFO = 0; - int iWorkSize = 0; - doubleComplex* pdblWork; - doubleComplex* pdblLeftvectors; - doubleComplex* pdblRightvectors; - doubleComplex* pdblRWork; - double* pdblRWork2; - double* outReal; - double* outImag; - doubleComplex* inCopy; - - inCopy = (doubleComplex*)malloc((unsigned int)(rows*rows) * sizeof(doubleComplex)); - outReal = (double*)malloc((unsigned int)rows * sizeof(double)); - outImag = (double*)malloc((unsigned int)rows * sizeof(double)); - pdblLeftvectors=NULL; - pdblRightvectors=NULL; - - iWorkSize = 2*rows; - pdblWork = (doubleComplex*)malloc((unsigned int)iWorkSize * sizeof(doubleComplex)); - pdblRWork = NULL; - pdblRWork2 = NULL; - - for(i=0;i<rows*rows;i++) { - inCopy[i]=DoubleComplex(zreals(in[i]),zimags(in[i])); - eigenvectors[i]=DoubleComplex(zreals(in[i]),zimags(in[i])); - } - zzerosa(eigenvalues,1,rows*rows); - - - /* look if the matrix is symmetric */ - for (i=0;i<rows;i++){ - for (j=0;j<rows;j++) - if ( (zreals(in[i*rows+j])!=zreals(zconjs(in[i+j*rows]))) || - (zimags(in[i*rows+j])!=zimags(zconjs(in[i+j*rows]))) ) - break; - if (j!=rows) break; - } - - - /* the matrix is symmetric if the 2 loops goes to end i.e - i==rows and j==rows */ - if ((i==rows)&&(j==rows)) hermitian=1; - - - /* apply lapack function according to symmetry */ - if(hermitian){ - pdblRWork2 = (double*)malloc((unsigned int)(3*rows) * sizeof(double)); - C2F(zheev)( "V", "U", &rows, eigenvectors, &rows, outReal, pdblWork, &iWorkSize, pdblRWork2, &INFO ); - dzerosa(outImag,1,rows); - for (i=0;i<rows;i++) eigenvalues[i+i*rows]=DoubleComplex(outReal[i],outImag[i]); - } - else { - pdblRWork = (doubleComplex*)malloc((unsigned int)(3*rows) * sizeof(doubleComplex)); - C2F(zgeev)( "N", "V", &rows, inCopy, &rows, eigenvalues, - pdblLeftvectors, &rows, eigenvectors, &rows, pdblWork, &iWorkSize, - pdblRWork, &INFO ); - for (i=1;i<rows;i++) { - eigenvalues[i+i*rows]=DoubleComplex(zreals(eigenvalues[i]),zimags(eigenvalues[i])); - eigenvalues[i]=DoubleComplex(0,0); - } - } - - - - - free(inCopy); - free(outReal); - free(outImag); - free(pdblWork); - free(pdblRWork); - free(pdblRWork2); - free(pdblLeftvectors); - free(pdblRightvectors); -} diff --git a/src/c/matrixOperations/toeplitz/ctoeplitza.c b/src/c/matrixOperations/toeplitz/ctoeplitza.c new file mode 100644 index 0000000..56c3ef8 --- /dev/null +++ b/src/c/matrixOperations/toeplitz/ctoeplitza.c @@ -0,0 +1,36 @@ +#include <stdio.h> +#include "toeplitz.h" +#include "floatComplex.h" +#include "stdlib.h" +#include "string.h" +#include "cat.h" + +/*Function to build a Toeplitz Matrix for inputs of SingleComplex datatype*/ + +void ctoeplitza(floatComplex* inp1,int size1,floatComplex* inp2,int size2,floatComplex* oup) +{ + if ((creals(inp1[0])!=creals(inp2[0]))&&(cimags(inp1[0])!=cimags(inp2[0]))) + { + printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz. + return; + } + int i, j; + + for(i=0;i<size1*size2;i++) oup[i] = FloatComplex(0,0); // Initializing the output matrix with zeros. + + for (i = 0; i<size1; i++) + { + for (j = 0; j<size2; j++) + { + oup[j*size1] = inp2[j]; // Elements of the second input vector are copied to the first row of the Toeplitx Matrix. + } + oup[i] = inp1[i]; // Elements of the first input vector are copied to the first column of the Toeplitx Matrix. + } + for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix. + { + if (creals(oup[i]) == 0 && cimags(oup[i]) == 0) + oup[i] = oup[i-size2-1]; + } +} + + diff --git a/src/c/matrixOperations/toeplitz/dtoeplitza.c b/src/c/matrixOperations/toeplitz/dtoeplitza.c new file mode 100644 index 0000000..ef075a9 --- /dev/null +++ b/src/c/matrixOperations/toeplitz/dtoeplitza.c @@ -0,0 +1,33 @@ +#include <stdio.h> +#include "toeplitz.h" + + +/*Function to build a Toeplitz Matrix for inputs of Double datatype*/ + + +void dtoeplitza(double* inp1,int size1,double* inp2,int size2,double* oup) +{ + if (inp1[0]!=inp2[0]) + { + printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz. + return; + } + int i, j; + + for(i=0;i<size1*size2;i++) oup[i] = 0; // Initializing the output matrix with zeros. + + for (i = 0; i<size1; i++) + { + for (j = 0; j<size2; j++) + { + oup[j*size1] = inp2[j]; // Elements of the second input vector are copied to the first row of the Toeplitx Matrix. + } + oup[i] = inp1[i]; // Elements of the first input vector are copied to the first column of the Toeplitx Matrix. + } + for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix. + { + if (oup[i] == 0) + oup[i] = oup[i-size2-1]; + } +} + diff --git a/src/c/matrixOperations/toeplitz/gtoeplitza.c b/src/c/matrixOperations/toeplitz/gtoeplitza.c new file mode 100644 index 0000000..c852f92 --- /dev/null +++ b/src/c/matrixOperations/toeplitz/gtoeplitza.c @@ -0,0 +1,35 @@ +#include <stdio.h> +#include "toeplitz.h" + + +/*Function to build a Toeplitz Matrix for inputs of Character datatype*/ + + +void gtoeplitza(char* inp1,int size1,char* inp2,int size2,char* oup) +{ + if (inp1[0]!=inp2[0]) + { + printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz. + return; + } + int i, j; + + for(i=0;i<size1*size2;i++) oup[i] = 0; // Initializing the output matrix with zeros. + + for (i = 0; i<size1; i++) + { + for (j = 0; j<size2; j++) + { + oup[j*size1] = inp2[j]; // Elements of the second input vector are copied to the first row of the Toeplitx Matrix. + } + oup[i] = inp1[i]; // Elements of the first input vector are copied to the first column of the Toeplitx Matrix. + } + for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix. + { + if (oup[i] == 0) + oup[i] = oup[i-size2-1]; + } + +} + + diff --git a/src/c/matrixOperations/toeplitz/i16toeplitza.c b/src/c/matrixOperations/toeplitz/i16toeplitza.c new file mode 100644 index 0000000..945f626 --- /dev/null +++ b/src/c/matrixOperations/toeplitz/i16toeplitza.c @@ -0,0 +1,32 @@ +#include <stdio.h> +#include "toeplitz.h" +#include "int16.h" + +/*Function to build a Toeplitz Matrix for inputs of Signed Int16 datatype*/ + + +void i16toeplitza(int16* inp1,int size1,int16* inp2,int size2,int16* oup) +{ + if (inp1[0]!=inp2[0]) + { + printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz. + return; + } + int i, j; + + for(i=0;i<size1*size2;i++) oup[i] = 0; // Initializing the output matrix with zeros. + + for (i = 0; i<size1; i++) + { + for (j = 0; j<size2; j++) + { + oup[j*size1] = inp2[j]; // Elements of the second input vector are copied to the first row of the Toeplitx Matrix. + } + oup[i] = inp1[i]; // Elements of the first input vector are copied to the first column of the Toeplitx Matrix. + } + for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix. + { + if (oup[i] == 0) + oup[i] = oup[i-size2-1]; + } +} diff --git a/src/c/matrixOperations/toeplitz/i8toeplitza.c b/src/c/matrixOperations/toeplitz/i8toeplitza.c new file mode 100644 index 0000000..5075cc1 --- /dev/null +++ b/src/c/matrixOperations/toeplitz/i8toeplitza.c @@ -0,0 +1,33 @@ +#include <stdio.h> +#include "toeplitz.h" +#include "int8.h" + + +/*Function to build a Toeplitz Matrix for inputs of Signed Int8 datatype*/ + + +void i8toeplitza(int8* inp1,int size1,int8* inp2,int size2,int8* oup) +{ + if (inp1[0]!=inp2[0]) + { + printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz. + return; + } + int i, j; + + for(i=0;i<size1*size2;i++) oup[i] = 0; // Initializing the output matrix with zeros. + + for (i = 0; i<size1; i++) + { + for (j = 0; j<size2; j++) + { + oup[j*size1] = inp2[j]; // Elements of the second input vector are copied to the first row of the Toeplitx Matrix. + } + oup[i] = inp1[i]; // Elements of the first input vector are copied to the first column of the Toeplitx Matrix. + } + for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix. + { + if (oup[i] == 0) + oup[i] = oup[i-size2-1]; + } +} diff --git a/src/c/matrixOperations/toeplitz/stoeplitza.c b/src/c/matrixOperations/toeplitz/stoeplitza.c new file mode 100644 index 0000000..11d91ce --- /dev/null +++ b/src/c/matrixOperations/toeplitz/stoeplitza.c @@ -0,0 +1,32 @@ +#include <stdio.h> +#include "toeplitz.h" + + +/*Function to build a Toeplitz Matrix for inputs of Float datatype*/ + + +void stoeplitza(float* inp1,int size1,float* inp2,int size2,float* oup) +{ + if (inp1[0]!=inp2[0]) + { + printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz. + return; + } + int i, j; + + for(i=0;i<size1*size2;i++) oup[i] = 0; // Initializing the output matrix with zeros. + + for (i = 0; i<size1; i++) + { + for (j = 0; j<size2; j++) + { + oup[j*size1] = inp2[j]; // Elements of the second input vector are copied to the first row of the Toeplitx Matrix. + } + oup[i] = inp1[i]; // Elements of the first input vector are copied to the first column of the Toeplitx Matrix. + } + for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix. + { + if (oup[i] == 0) + oup[i] = oup[i-size2-1]; + } +} diff --git a/src/c/matrixOperations/toeplitz/u16toeplitza.c b/src/c/matrixOperations/toeplitz/u16toeplitza.c new file mode 100644 index 0000000..8dab545 --- /dev/null +++ b/src/c/matrixOperations/toeplitz/u16toeplitza.c @@ -0,0 +1,33 @@ +#include <stdio.h> +#include "toeplitz.h" +#include "uint16.h" + + +/*Function to build a Toeplitz Matrix for inputs of Unsigned Int16 datatype*/ + + +void u16toeplitza(uint16* inp1,int size1,uint16* inp2,int size2,uint16* oup) +{ + if (inp1[0]!=inp2[0]) + { + printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz. + return; + } + int i, j; + + for(i=0;i<size1*size2;i++) oup[i] = 0; // Initializing the output matrix with zeros. + + for (i = 0; i<size1; i++) + { + for (j = 0; j<size2; j++) + { + oup[j*size1] = inp2[j]; // Elements of the second input vector are copied to the first row of the Toeplitx Matrix. + } + oup[i] = inp1[i]; // Elements of the first input vector are copied to the first column of the Toeplitx Matrix. + } + for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix. + { + if (oup[i] == 0) + oup[i] = oup[i-size2-1]; + } +} diff --git a/src/c/matrixOperations/toeplitz/u8toeplitza.c b/src/c/matrixOperations/toeplitz/u8toeplitza.c new file mode 100644 index 0000000..8301fc1 --- /dev/null +++ b/src/c/matrixOperations/toeplitz/u8toeplitza.c @@ -0,0 +1,33 @@ +#include <stdio.h> +#include "toeplitz.h" +#include "uint8.h" + + +/*Function to build a Toeplitz Matrix for inputs of Unsigned Int8 datatype*/ + + +void u8toeplitza(uint8* inp1,int size1,uint8* inp2,int size2,uint8* oup) +{ + if (inp1[0]!=inp2[0]) + { + printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz. + return; + } + int i, j; + + for(i=0;i<size1*size2;i++) oup[i] = 0; // Initializing the output matrix with zeros. + + for (i = 0; i<size1; i++) + { + for (j = 0; j<size2; j++) + { + oup[j*size1] = inp2[j]; // Elements of the second input vector are copied to the first row of the Toeplitx Matrix. + } + oup[i] = inp1[i]; // Elements of the first input vector are copied to the first column of the Toeplitx Matrix. + } + for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix. + { + if (oup[i] == 0) + oup[i] = oup[i-size2-1]; + } +} diff --git a/src/c/matrixOperations/toeplitz/ztoeplitza.c b/src/c/matrixOperations/toeplitz/ztoeplitza.c new file mode 100644 index 0000000..117f818 --- /dev/null +++ b/src/c/matrixOperations/toeplitz/ztoeplitza.c @@ -0,0 +1,36 @@ +#include <stdio.h> +#include "toeplitz.h" +#include "doubleComplex.h" +#include "stdlib.h" +#include "string.h" +#include "cat.h" + + +/*Function to build a Toeplitz Matrix for inputs of DoubleComplex datatype*/ + + +void ztoeplitza(doubleComplex* inp1,int size1,doubleComplex* inp2,int size2,doubleComplex* oup) +{ + if ((zreals(inp1[0])!=zreals(inp2[0]))&&(zimags(inp1[0])!=zimags(inp2[0]))) + { + printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz. + return; + } + int i, j; + + for(i=0;i<size1*size2;i++) oup[i] = 0; // Initializing the output matrix with zeros. + + for (i = 0; i<size1; i++) + { + for (j = 0; j<size2; j++) + { + oup[j*size1] = inp2[j]; // Elements of the second input vector are copied to the first row of the Toeplitx Matrix. + } + oup[i] = inp1[i]; // Elements of the first input vector are copied to the first column of the Toeplitx Matrix. + } + for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix. + { + if (zreals(oup[i]) == 0 && zimags(oup[i]) == 0) + oup[i] = oup[i-size2-1]; + } +} diff --git a/src/c/operations/addition/zadds.c b/src/c/operations/addition/zadds.c index d4a94dc..768faf3 100644 --- a/src/c/operations/addition/zadds.c +++ b/src/c/operations/addition/zadds.c @@ -11,6 +11,7 @@ */ #include "addition.h" +#include "doubleComplex.h" doubleComplex zadds(doubleComplex z1, doubleComplex z2) { return DoubleComplex(zreals(z1) + zreals(z2), diff --git a/src/c/scilab-arduino/cmd_analog_in_volt/u8cmd_analog_in_volts.c b/src/c/scilab-arduino/cmd_analog_in_volt/u8cmd_analog_in_volts.c index 7018df2..f961719 100644 --- a/src/c/scilab-arduino/cmd_analog_in_volt/u8cmd_analog_in_volts.c +++ b/src/c/scilab-arduino/cmd_analog_in_volt/u8cmd_analog_in_volts.c @@ -15,8 +15,8 @@ float u8cmd_analog_in_volts(uint8 board_no, uint8 pin) { - float a; - a = ((5*(float)analogRead(pin))/1023); + float a; //declaration of variable + a = ((5*(float)analogRead(pin))/1023); //recieved 10 bit input from analog pin is convert to voltage(0 - 50 return(a); } diff --git a/src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c b/src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c index 2dd82e4..1d76b60 100644 --- a/src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c +++ b/src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c @@ -15,8 +15,8 @@ void u8cmd_analog_out_volts(uint8 board_no, uint8 pin, float value) { - int a; - a = ((value*255)/5); - analogWrite(pin,a); + int a; //declaring variable + a = ((value*255)/5); //converting given voltage to duty cycle value (0 - 255) + analogWrite(pin,a); //passing pin no. and duty cycle value } diff --git a/src/c/scilab-arduino/cmd_dcmotor_release/u8cmd_dcmotor_releases.c b/src/c/scilab-arduino/cmd_dcmotor_release/u8cmd_dcmotor_releases.c index 349bcb1..d56d12d 100644 --- a/src/c/scilab-arduino/cmd_dcmotor_release/u8cmd_dcmotor_releases.c +++ b/src/c/scilab-arduino/cmd_dcmotor_release/u8cmd_dcmotor_releases.c @@ -15,15 +15,15 @@ void u8cmd_dcmotor_releases(uint8 board_no, uint8 motor_no) { - if (dcm_mode[motor_no] == 3) + if (dcm_mode[motor_no] == 3) //for IC accepting analog value { - analogWrite(dcm_pin_1[motor_no],0); + analogWrite(dcm_pin_1[motor_no],0); //passing LOW to IC pins to stop the motor analogWrite(dcm_pin_2[motor_no],0); } - else + else //for IC accepting digital value { digitalWrite(dcm_pin_1[motor_no],LOW); - digitalWrite(dcm_pin_2[motor_no],LOW); + digitalWrite(dcm_pin_2[motor_no],LOW); //passing LOW to IC pins to stop the motor } } diff --git a/src/c/scilab-arduino/cmd_i2c_dev/u8cmd_i2c_devs.cpp b/src/c/scilab-arduino/cmd_i2c_dev/u8cmd_i2c_devs.cpp index adc1a6e..eb9ec10 100644 --- a/src/c/scilab-arduino/cmd_i2c_dev/u8cmd_i2c_devs.cpp +++ b/src/c/scilab-arduino/cmd_i2c_dev/u8cmd_i2c_devs.cpp @@ -1,10 +1,23 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +//This function establishes I2C communication between arduino and given device + #include "cmd_i2c_dev.h" #include "Arduino.h" #include "Wire.h" - uint8 u8cmd_i2c_devs(uint8 address) { - Wire.begin(); - return((uint8)address); + Wire.begin(); //To initiate connection + return((uint8)address); //Returns address to create a device object } diff --git a/src/c/scilab-arduino/cmd_i2c_read/u8cmd_i2c_reads.cpp b/src/c/scilab-arduino/cmd_i2c_read/u8cmd_i2c_reads.cpp index 8f02a87..24d36de 100644 --- a/src/c/scilab-arduino/cmd_i2c_read/u8cmd_i2c_reads.cpp +++ b/src/c/scilab-arduino/cmd_i2c_read/u8cmd_i2c_reads.cpp @@ -1,3 +1,17 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +//This function reads data from I2C bus. #include "cmd_i2c_read.h" #include "Arduino.h" #include "Wire.h" diff --git a/src/c/scilab-arduino/cmd_i2c_read_register/u8cmd_i2c_read_registers.cpp b/src/c/scilab-arduino/cmd_i2c_read_register/u8cmd_i2c_read_registers.cpp index 0a2ec2e..fd07eb6 100644 --- a/src/c/scilab-arduino/cmd_i2c_read_register/u8cmd_i2c_read_registers.cpp +++ b/src/c/scilab-arduino/cmd_i2c_read_register/u8cmd_i2c_read_registers.cpp @@ -1,3 +1,17 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +//this function reads data from the device register with given address #include "cmd_i2c_read_register.h" #include "Arduino.h" #include "Wire.h" diff --git a/src/c/scilab-arduino/cmd_i2c_write/u8cmd_i2c_writes.cpp b/src/c/scilab-arduino/cmd_i2c_write/u8cmd_i2c_writes.cpp index 0239097..b777225 100644 --- a/src/c/scilab-arduino/cmd_i2c_write/u8cmd_i2c_writes.cpp +++ b/src/c/scilab-arduino/cmd_i2c_write/u8cmd_i2c_writes.cpp @@ -1,3 +1,16 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +//This function writes data to the connected device #include "cmd_i2c_write.h" #include "Arduino.h" #include "Wire.h" diff --git a/src/c/scilab-arduino/cmd_i2c_write_register/u8cmd_i2c_write_registers.cpp b/src/c/scilab-arduino/cmd_i2c_write_register/u8cmd_i2c_write_registers.cpp index 63cc7c7..9e3c11c 100644 --- a/src/c/scilab-arduino/cmd_i2c_write_register/u8cmd_i2c_write_registers.cpp +++ b/src/c/scilab-arduino/cmd_i2c_write_register/u8cmd_i2c_write_registers.cpp @@ -1,3 +1,17 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +//This function writes to the register of the device #include "cmd_i2c_write_register.h" #include "Arduino.h" #include "Wire.h" diff --git a/src/c/scilab-arduino/default_files/sci2c_arduino.ino b/src/c/scilab-arduino/default_files/sci2c_arduino.ino index df28950..1d4465b 100644 --- a/src/c/scilab-arduino/default_files/sci2c_arduino.ino +++ b/src/c/scilab-arduino/default_files/sci2c_arduino.ino @@ -11,8 +11,8 @@ */ #include "Arduino.h" -#include <loop_arduino.h> -#include <setup_arduino.h> +#include "loop_arduino.h" +#include "setup_arduino.h" void setup() { diff --git a/src/c/scilab-arduino/includes/cmd_i2c_dev.h b/src/c/scilab-arduino/includes/cmd_i2c_dev.h index 861a8e7..382c2b3 100644 --- a/src/c/scilab-arduino/includes/cmd_i2c_dev.h +++ b/src/c/scilab-arduino/includes/cmd_i2c_dev.h @@ -1,3 +1,15 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + #ifndef __CMD_I2C_DEV_H__ #define __CMD_I2C_DEV_H__ diff --git a/src/c/scilab-arduino/includes/cmd_i2c_read.h b/src/c/scilab-arduino/includes/cmd_i2c_read.h index 791bdd3..e33ede3 100644 --- a/src/c/scilab-arduino/includes/cmd_i2c_read.h +++ b/src/c/scilab-arduino/includes/cmd_i2c_read.h @@ -1,3 +1,15 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + #ifndef __CMD_I2C_READ_H__ #define __CMD_I2C_READ_H__ diff --git a/src/c/scilab-arduino/includes/cmd_i2c_read_register.h b/src/c/scilab-arduino/includes/cmd_i2c_read_register.h index ea203ad..50fba93 100644 --- a/src/c/scilab-arduino/includes/cmd_i2c_read_register.h +++ b/src/c/scilab-arduino/includes/cmd_i2c_read_register.h @@ -1,3 +1,15 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + #ifndef __CMD_I2C_READ_REGISTER_H__ #define __CMD_I2C_READ_REGISTER_H__ diff --git a/src/c/scilab-arduino/includes/cmd_i2c_write.h b/src/c/scilab-arduino/includes/cmd_i2c_write.h index 6a57222..128f1af 100644 --- a/src/c/scilab-arduino/includes/cmd_i2c_write.h +++ b/src/c/scilab-arduino/includes/cmd_i2c_write.h @@ -1,3 +1,15 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + #ifndef __CMD_I2C_WRITE_H__ #define __CMD_I2C_WRITE_H__ diff --git a/src/c/scilab-arduino/includes/cmd_i2c_write_register.h b/src/c/scilab-arduino/includes/cmd_i2c_write_register.h index ff1b9ec..7fac4cb 100644 --- a/src/c/scilab-arduino/includes/cmd_i2c_write_register.h +++ b/src/c/scilab-arduino/includes/cmd_i2c_write_register.h @@ -1,3 +1,15 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + #ifndef __CMD_I2C_WRITE_REGISTER_H__ #define __CMD_I2C_WRITE_REGISTER_H__ diff --git a/src/c/scilab-arduino/interfaces/int_cmd_i2c_dev.h b/src/c/scilab-arduino/interfaces/int_cmd_i2c_dev.h index c4d93d7..85f3e3c 100644 --- a/src/c/scilab-arduino/interfaces/int_cmd_i2c_dev.h +++ b/src/c/scilab-arduino/interfaces/int_cmd_i2c_dev.h @@ -1,3 +1,15 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + #ifndef __INT_CMD_I2C_DEV_H__ #define __INT_CMD_I2C_DEV_H__ diff --git a/src/c/scilab-arduino/interfaces/int_cmd_i2c_read.h b/src/c/scilab-arduino/interfaces/int_cmd_i2c_read.h index b0633a0..6ffd7ec 100644 --- a/src/c/scilab-arduino/interfaces/int_cmd_i2c_read.h +++ b/src/c/scilab-arduino/interfaces/int_cmd_i2c_read.h @@ -1,3 +1,15 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + #ifndef __INT_CMD_I2C_READ_H__ #define __INT_CMD_I2C_READ_H__ diff --git a/src/c/scilab-arduino/interfaces/int_cmd_i2c_read_register.h b/src/c/scilab-arduino/interfaces/int_cmd_i2c_read_register.h index 5f4c529..e848b69 100644 --- a/src/c/scilab-arduino/interfaces/int_cmd_i2c_read_register.h +++ b/src/c/scilab-arduino/interfaces/int_cmd_i2c_read_register.h @@ -1,3 +1,15 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + #ifndef __INT_CMD_I2C_READ_REGISTER_H__ #define __INT_CMD_I2C_READ_REGISTER_H__ diff --git a/src/c/scilab-arduino/interfaces/int_cmd_i2c_write.h b/src/c/scilab-arduino/interfaces/int_cmd_i2c_write.h index a7705a8..3a01593 100644 --- a/src/c/scilab-arduino/interfaces/int_cmd_i2c_write.h +++ b/src/c/scilab-arduino/interfaces/int_cmd_i2c_write.h @@ -1,3 +1,15 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + #ifndef __INT_CMD_I2C_WRITE_H__ #define __INT_CMD_I2C_WRITE_H__ diff --git a/src/c/scilab-arduino/interfaces/int_cmd_i2c_write_register.h b/src/c/scilab-arduino/interfaces/int_cmd_i2c_write_register.h index 35c0527..78a3382 100644 --- a/src/c/scilab-arduino/interfaces/int_cmd_i2c_write_register.h +++ b/src/c/scilab-arduino/interfaces/int_cmd_i2c_write_register.h @@ -1,3 +1,15 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + #ifndef __INT_CMD_I2C_WRITE_REGISTER_H__ #define __INT_CMD_I2C_WRITE_REGISTER_H__ diff --git a/src/c/signalProcessing/%k/dmodka.c b/src/c/signalProcessing/%k/dmodka.c index c0630ec..8368cb6 100644 --- a/src/c/signalProcessing/%k/dmodka.c +++ b/src/c/signalProcessing/%k/dmodka.c @@ -1,3 +1,14 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Ankit Raj + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ #include<stdio.h> #include<math.h> #include "modk.h" @@ -10,7 +21,6 @@ double max_calc(double* ptr,int sz) ptr[0]=-1*ptr[0]; } mx=(ptr[0]); - //printf("%lf\n",mx); for(i=1;i<sz;i++) { if(ptr[i]<0) @@ -47,10 +57,7 @@ void dmodka(double* inp,int size,double* oup) c[l]=sqrt(inp[l]); } - int x=0; - //double maxi; - //maxi=max_calc(c,size); - //printf("%lf",maxi); + int x=0; while(max_calc(c,size)>eps) { @@ -88,10 +95,4 @@ void dmodka(double* inp,int size,double* oup) } } -/* -int main() -{ - double m[3]={0.1,0.2,0.3}; - dka(m,3); -} -*/ + diff --git a/src/c/signalProcessing/%sn/dmodsns.c b/src/c/signalProcessing/%sn/dmodsns.c index 06d0a6f..aae16c1 100644 --- a/src/c/signalProcessing/%sn/dmodsns.c +++ b/src/c/signalProcessing/%sn/dmodsns.c @@ -82,12 +82,4 @@ double dmodsns(double uu, double emmc) } return sn; } -/* -int main() -{ - double u,k; - u=4; - k=0.7; - sn(u,k); -} -*/ + diff --git a/src/c/signalProcessing/ell1mag/dell1maga.c b/src/c/signalProcessing/ell1mag/dell1maga.c index 9af0c8e..58ef303 100644 --- a/src/c/signalProcessing/ell1mag/dell1maga.c +++ b/src/c/signalProcessing/ell1mag/dell1maga.c @@ -21,7 +21,7 @@ void dell1maga(double eps,double m1,double* z,int size,double* oup ) int i; for(i=0;i<size;i++) { - s[i]=zmodsns(z[i],m1); + s[i]=dmodsns(z[i],m1); } double un[size]; int j; diff --git a/src/c/signalProcessing/ell1mag/zell1maga.c b/src/c/signalProcessing/ell1mag/zell1maga.c index 6e7a6f9..35b4928 100644 --- a/src/c/signalProcessing/ell1mag/zell1maga.c +++ b/src/c/signalProcessing/ell1mag/zell1maga.c @@ -14,6 +14,9 @@ #include "modsn.h" #include "ell1mag.h" #include "doubleComplex.h" +#include "multiplication.h" +#include "addition.h" +#include "division.h" void zell1maga(double eps,double m1,doubleComplex* z,int size,double* oup ) { @@ -31,9 +34,15 @@ void zell1maga(double eps,double m1,doubleComplex* z,int size,double* oup ) } doubleComplex v; int k; + double ml; + ml=eps*eps; + doubleComplex tp1,tp2,tp3; for(k=0;k<size;k++) { - v=un[k]/(un[k]+(eps*eps*s[k]*s[k])); + tp1=zmuls(s[k],s[k]); + tp2=DoubleComplex(ml,0); + tp3=DoubleComplex(un[k],0); + v=zrdivs(tp3,zadds(tp3,(zmuls(tp2,tp1)))); oup[k]=zreals(v); } } diff --git a/src/c/signalProcessing/ffilt/gffilts.c b/src/c/signalProcessing/ffilt/gffilts.c index 538daf3..09876d0 100644 --- a/src/c/signalProcessing/ffilt/gffilts.c +++ b/src/c/signalProcessing/ffilt/gffilts.c @@ -80,11 +80,4 @@ void gffilts(char* ft,int size,double N,double fc,double fh,double* oup) oup[id]=1+oup[id]; } } -/* -int main() -{ - string s; - int n; - double fl,fh; -} -*/ + diff --git a/src/c/signalProcessing/fsfirlin/dfsfirlina.c b/src/c/signalProcessing/fsfirlin/dfsfirlina.c index d2079f4..e44f464 100644 --- a/src/c/signalProcessing/fsfirlin/dfsfirlina.c +++ b/src/c/signalProcessing/fsfirlin/dfsfirlina.c @@ -11,11 +11,9 @@ */ #include<stdio.h> - #include<math.h> #include "sincd.h" #include "fsfirlin.h" -//#define PI 3.14159265358979 void dfsfirlina(double* hd,int size,double flag,double* hst) { diff --git a/src/c/signalProcessing/sincd/dsincds.c b/src/c/signalProcessing/sincd/dsincds.c index 1475d8d..c9f2f81 100644 --- a/src/c/signalProcessing/sincd/dsincds.c +++ b/src/c/signalProcessing/sincd/dsincds.c @@ -13,7 +13,6 @@ #include<stdio.h> #include<math.h> #include "sincd.h" -//#define PI 3.14159265358979 void dsincds(double n,double flg,double* oup) { double npt=4*n; diff --git a/src/c/signalProcessing/sincd/u8sincds.c b/src/c/signalProcessing/sincd/u8sincds.c index d03f48a..ff0a2ac 100644 --- a/src/c/signalProcessing/sincd/u8sincds.c +++ b/src/c/signalProcessing/sincd/u8sincds.c @@ -13,12 +13,11 @@ #include<stdio.h> #include<math.h> #include "sincd.h" -#define PI 3.14159265358979 void u8sincds(int n,int flg,double* oup) { double npt=4*n; int sz=4*n; - double pas=PI/npt; + double pas=M_PI/npt; double om[sz+1]; int i; //om[0]=0; @@ -69,7 +68,7 @@ void u8sincds(int n,int flg,double* oup) int a; for(a=0;a<=4*n;a++) { - om[a]=om[a]-(PI/(2*n)); + om[a]=om[a]-(M_PI/(2*n)); } int j,k; for(j=0;j<=4*n;j++) diff --git a/src/c/signalProcessing/zmodsns.c b/src/c/signalProcessing/zmodsns.c new file mode 100644 index 0000000..5f35059 --- /dev/null +++ b/src/c/signalProcessing/zmodsns.c @@ -0,0 +1,161 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Ankit Raj + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + Reference:- Abramowitz, Milton and Stegun, Irene A + Handbook of Mathematical Functions, Dover, 1965 + Chapter 16 (Sections 16.4, 16.13 and 16.15) + Link for FORTRAN code:-http://www.aip.de/groups/soe/local/numres/bookfpdf/f6-11.pdf +*/ + +#include<stdio.h> +#include<math.h> +#include "modsn.h" +#include "doubleComplex.h" +#define CA 0.0003 + +doubleComplex zmodsns(doubleComplex uu,double emmc) +{ + doubleComplex ans; + double uur,uui; + uur=zreals(uu); + uui=zimags(uu); + double sr,cr,dr; + //Performing Elliptic Function operation for the real values + double a1,b1,c1,d1,emc1,u1; + double em1[14],en1[14]; + int i1,ii1,l1,bo1; + emc1=1-emmc; + u1=uur; + if(emc1) + { + bo1=(emc1<0.0); + if(bo1) + { + d1=1.0-emc1; + emc1/=-1.0/d1; + u1*=(d1=sqrt(d1)); + } + a1=1.0; + dr=1.0; + for(i1=1;i1<=13;i1++) + { + l1=i1; + em1[i1]=a1; + en1[i1]=(emc1=sqrt(emc1)); + c1=0.5*(a1+emc1); + if(fabs(a1-emc1)<=CA*a1)break; + emc1*=a1; + a1=c1; + } + u1*=c1; + sr=sin(u1); + cr=cos(u1); + if(sr) + { + a1=cr/sr; + c1*=a1; + for(ii1=l1;ii1>=1;ii1--) + { + b1=em1[ii1]; + a1*=c1; + c1*=dr; + dr=(en1[ii1]+a1)/(b1+a1); + a1=c1/b1; + } + a1=1.0/sqrt(c1*c1+1.0); + sr=(sr>=0.0?a1:-a1); + cr=c1*(sr); + } + if(bo1) + { + a1=dr; + dr=cr; + cr=a1; + sr/=d1; + } + } + else + { + cr=1.0/cosh(u1); + dr=cr; + sr=tanh(u1); + } + //////////////////////////////////////////////////////////////// + double si,ci,di; + //Performing Elleptic Function operation for the imaginary values + double a,b,c,d,emc,u; + double em[14],en[14]; + int i,ii,l,bo; + //double s1,c1,d1; + emc=emmc; + u=uui; + if(emc) + { + bo=(emc<0.0); + if(bo) + { + d=1.0-emc; + emc/=-1.0/d; + u*=(d=sqrt(d)); + } + a=1.0; + di=1.0; + for(i=1;i<=13;i++) + { + l=i; + em[i]=a; + en[i]=(emc=sqrt(emc)); + c=0.5*(a+emc); + if(fabs(a-emc)<=CA*a)break; + emc*=a; + a=c; + } + u*=c; + si=sin(u); + ci=cos(u); + if(si) + { + a=ci/si; + c*=a; + for(ii=l;ii>=1;ii--) + { + b=em[ii]; + a*=c; + c*=di; + di=(en[ii]+a)/(b+a); + a=c/b; + } + a=1.0/sqrt(c*c+1.0); + si=(si>=0.0?a:-a); + ci=c*(si); + } + if(bo) + { + a=di; + di=ci; + ci=a; + si/=d; + } + } + else + { + ci=1.0/cosh(u); + di=ci; + si=tanh(u); + } + ///////////////////////////////////////////////////////// + double delta; + delta=ci*ci + emmc*sr*sr*si*si; + double snir,snii; + snir=(sr*di)/delta; + snii=(cr*dr*si*ci)/delta; + ans=DoubleComplex(snir,snii); + return ans; +} diff --git a/src/c/signalProcessing/zpbutt/dzpbutts.c b/src/c/signalProcessing/zpbutt/dzpbutts.c index 33f22af..7b9fe9b 100644 --- a/src/c/signalProcessing/zpbutt/dzpbutts.c +++ b/src/c/signalProcessing/zpbutt/dzpbutts.c @@ -12,6 +12,7 @@ #include<stdio.h> #include<math.h> #include "zpbutt.h" +#include "doubleComplex.h" #define PI 3.14159265 double dzpbutts(double n,double fl,doubleComplex* out) { diff --git a/src/c/specialFunctions/erf/derfa.c b/src/c/specialFunctions/erf/derfa.c new file mode 100644 index 0000000..972d743 --- /dev/null +++ b/src/c/specialFunctions/erf/derfa.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "erf.h" + +void derfa(double* inp1, int sizer, int sizec,double* out) +{ + for (int i = 0; i < sizer*sizec; i++) + { + out[i] = erf(inp1[i]); + } +} + diff --git a/src/c/specialFunctions/erf/derfs.c b/src/c/specialFunctions/erf/derfs.c new file mode 100644 index 0000000..22b5d64 --- /dev/null +++ b/src/c/specialFunctions/erf/derfs.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "erf.h" + +double derfs(double inp1) +{ + return erf(inp1); +} + diff --git a/src/c/specialFunctions/erf/serfa.c b/src/c/specialFunctions/erf/serfa.c new file mode 100644 index 0000000..0db4a7b --- /dev/null +++ b/src/c/specialFunctions/erf/serfa.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "erf.h" + +void serfa(float* inp1, int sizer, int sizec,float* out) +{ + for (int i = 0; i < sizer*sizec; i++) + { + out[i] = erf(inp1[i]); + } +} + diff --git a/src/c/specialFunctions/erf/serfs.c b/src/c/specialFunctions/erf/serfs.c new file mode 100644 index 0000000..66638a1 --- /dev/null +++ b/src/c/specialFunctions/erf/serfs.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "erf.h" + +float serfs(float inp1) +{ + return erf(inp1); +} + diff --git a/src/c/specialFunctions/erfc/derfca.c b/src/c/specialFunctions/erfc/derfca.c new file mode 100644 index 0000000..85c92ef --- /dev/null +++ b/src/c/specialFunctions/erfc/derfca.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "erfc.h" + +void derfca(double* inp1, int sizer, int sizec, double* out) +{ + for (int i = 0; i < sizer*sizec; i++) + { + out[i] = derfcs(inp1[i]); + } +} + diff --git a/src/c/specialFunctions/erfc/derfcs.c b/src/c/specialFunctions/erfc/derfcs.c new file mode 100644 index 0000000..31c9846 --- /dev/null +++ b/src/c/specialFunctions/erfc/derfcs.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "erfc.h" + +double derfcs(double inp1) +{ + return (1-erf(inp1)); +} + diff --git a/src/c/specialFunctions/erfc/serfca.c b/src/c/specialFunctions/erfc/serfca.c new file mode 100644 index 0000000..469c5a1 --- /dev/null +++ b/src/c/specialFunctions/erfc/serfca.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "erfc.h" + +void serfca(float* inp1, int sizer, int sizec, float* out) +{ + for (int i = 0; i < sizer*sizec; i++) + { + out[i] = serfcs(inp1[i]); + } +} + diff --git a/src/c/specialFunctions/erfc/serfcs.c b/src/c/specialFunctions/erfc/serfcs.c new file mode 100644 index 0000000..3f93a80 --- /dev/null +++ b/src/c/specialFunctions/erfc/serfcs.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "erfc.h" + +float serfcs(float inp1) +{ + return (1-erf(inp1)); +} + diff --git a/src/c/specialFunctions/erfcx/derfcxa.c b/src/c/specialFunctions/erfcx/derfcxa.c new file mode 100644 index 0000000..d2cd750 --- /dev/null +++ b/src/c/specialFunctions/erfcx/derfcxa.c @@ -0,0 +1,26 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "erfcx.h" +#include "erfc.h" + +void derfcxa(double* inp1, int sizer, int sizec, double* out) +{ + for (int i = 0; i < sizer*sizec; i++) + { + out[i] = derfcxs(inp1[i]); + } +} + diff --git a/src/c/specialFunctions/erfcx/derfcxs.c b/src/c/specialFunctions/erfcx/derfcxs.c new file mode 100644 index 0000000..ff12b2f --- /dev/null +++ b/src/c/specialFunctions/erfcx/derfcxs.c @@ -0,0 +1,23 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "erfcx.h" +#include "erfc.h" + +double derfcxs(double inp1) +{ + return exp(inp1*inp1)*derfcs(inp1); +} + diff --git a/src/c/specialFunctions/erfcx/serfcxa.c b/src/c/specialFunctions/erfcx/serfcxa.c new file mode 100644 index 0000000..a28c30c --- /dev/null +++ b/src/c/specialFunctions/erfcx/serfcxa.c @@ -0,0 +1,26 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "erfcx.h" +#include "erfc.h" + +void serfcxa(float* inp1, int sizer, int sizec, float* out) +{ + for (int i = 0; i < sizer*sizec; i++) + { + out[i] = serfcxs(inp1[i]); + } +} + diff --git a/src/c/specialFunctions/erfcx/serfcxs.c b/src/c/specialFunctions/erfcx/serfcxs.c new file mode 100644 index 0000000..be31a5a --- /dev/null +++ b/src/c/specialFunctions/erfcx/serfcxs.c @@ -0,0 +1,23 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "erfcx.h" +#include "erfc.h" + +float serfcxs(float inp1) +{ + return exp(inp1*inp1)*derfcs(inp1); +} + diff --git a/src/c/specialFunctions/erfinv/derfinva.c b/src/c/specialFunctions/erfinv/derfinva.c new file mode 100644 index 0000000..45d119c --- /dev/null +++ b/src/c/specialFunctions/erfinv/derfinva.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "erfinv.h" + +void derfinva(double* inp1, int sizer, int sizec,double* out) +{ + for (int i = 0; i < sizer*sizec; i++) + { + out[i] = derfinvs(inp1[i]); + } +} + diff --git a/src/c/specialFunctions/erfinv/derfinvs.c b/src/c/specialFunctions/erfinv/derfinvs.c new file mode 100644 index 0000000..3f7fe76 --- /dev/null +++ b/src/c/specialFunctions/erfinv/derfinvs.c @@ -0,0 +1,49 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "erfinv.h" + +# define PI 3.1415927 + +double derfinvs (double inp1) +{ + double a[] = {0.88622692374517353,-1.6601283962374516,0.92661860147244357,-0.14110320437680104}; //Coefficients for the formula to calculate inverse error + double b[] = {-2.13505380615258078,1.46060340345661088,-0.33198239813321595,0.01197270616590528}; //Coefficients for the formula to calculate inverse error + double c[] = {-1.994216456587148,-1.87267416351196,3.60874665878559364,1.82365845766309853}; //Coefficients for the formula to calculate inverse error + double d[] = {3.74146294065960872,1.81848952562894617}; //Coefficients for the formula to calculate inverse error + + if ((inp1 > 1) || (inp1 < -1)) + { + return 0.0/0.0; // returns Nan + } + if ((inp1 >= -0.7) && (inp1 <= 0.7)) + { + double sq = inp1 * inp1; + return (inp1 * (((a[3]*sq+a[2]) * sq+a[1]) * sq+a[0]) / ((((b[3]*sq+b[2]) * sq+b[1]) * sq+b[0]) * sq+1)); //Inverse error formula + } + + else if ((inp1 > 0.7) && (inp1 < 1)) + { + double z = sqrt(-log((1-inp1)/2)); + return ((((c[3]*z+c[2]) * z+c[1]) * z+c[0]) / ((d[1]*z+d[0]) * z+1)); //Inverse error formula + } + + else if ((inp1 > -1) && (inp1 < 0.7)) + { + double z = sqrt(-log((1+inp1)/2)); + return (-(((c[3]*z+c[2]) * z+c[1]) * z+c[0]) / ((d[1]*z+d[0]) * z+1)); //Inverse error formula + } +} + diff --git a/src/c/specialFunctions/erfinv/serfinva.c b/src/c/specialFunctions/erfinv/serfinva.c new file mode 100644 index 0000000..3a14f3c --- /dev/null +++ b/src/c/specialFunctions/erfinv/serfinva.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "erfinv.h" + +void serfinva(float* inp1, int sizer, int sizec,float* out) +{ + for (int i = 0; i < sizer*sizec; i++) + { + out[i] = serfinvs(inp1[i]); + } +} + diff --git a/src/c/specialFunctions/erfinv/serfinvs.c b/src/c/specialFunctions/erfinv/serfinvs.c new file mode 100644 index 0000000..5436fe3 --- /dev/null +++ b/src/c/specialFunctions/erfinv/serfinvs.c @@ -0,0 +1,50 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "erfinv.h" + +# define PI 3.1415927 + +float serfinvs (float inp1) +{ + float a[] = {0.88622692374517353,-1.6601283962374516,0.92661860147244357,-0.14110320437680104}; //Coefficients for the formula to calculate inverse error + float b[] = {-2.13505380615258078,1.46060340345661088,-0.33198239813321595,0.01197270616590528}; //Coefficients for the formula to calculate inverse error + float c[] = {-1.994216456587148,-1.87267416351196,3.60874665878559364,1.82365845766309853}; //Coefficients for the formula to calculate inverse error + float d[] = {3.74146294065960872,1.81848952562894617}; //Coefficients for the formula to calculate inverse error + + if ((inp1 > 1) || (inp1 < -1)) + { + double na = 0.0/0.0; + return (float)na; + } + if ((inp1 >= -0.7) && (inp1 <= 0.7)) + { + float sq = inp1 * inp1; + return (inp1 * (((a[3]*sq+a[2]) * sq+a[1]) * sq+a[0]) / ((((b[3]*sq+b[2]) * sq+b[1]) * sq+b[0]) * sq+1)); //Inverse error formula + } + + else if ((inp1 > 0.7) && (inp1 < 1)) + { + float z = sqrt(-log((1-inp1)/2)); + return ((((c[3]*z+c[2]) * z+c[1]) * z+c[0]) / ((d[1]*z+d[0]) * z+1)); //Inverse error formula + } + + else if ((inp1 > -1) && (inp1 < 0.7)) + { + float z = sqrt(-log((1+inp1)/2)); + return (-(((c[3]*z+c[2]) * z+c[1]) * z+c[0]) / ((d[1]*z+d[0]) * z+1)); //Inverse error formula + } +} + diff --git a/src/c/specialFunctions/includes/erf.h b/src/c/specialFunctions/includes/erf.h new file mode 100644 index 0000000..86bb15d --- /dev/null +++ b/src/c/specialFunctions/includes/erf.h @@ -0,0 +1,35 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#ifndef __ERF_H__ +#define __ERF_H__ +#include "types.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "uint8.h" +#include "uint16.h" +#include "int16.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double derfs(double inp1); +float serfs(float inp1); +void derfa(double* inp1, int sizer, int sizec,double* out); +void serfa(float* inp1, int sizer, int sizec,float* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__ERF_H__*/ diff --git a/src/c/specialFunctions/includes/erfc.h b/src/c/specialFunctions/includes/erfc.h new file mode 100644 index 0000000..509e34e --- /dev/null +++ b/src/c/specialFunctions/includes/erfc.h @@ -0,0 +1,36 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __ERFC_H__ +#define __ERFC_H__ +#include "types.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "uint8.h" +#include "uint16.h" +#include "int16.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double derfcs(double inp1); +void derfca(double* inp1, int sizer, int sizec,double* out); +float serfcs(float inp1); +void serfca(float* inp1, int sizer, int sizec, float* out); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__ERFC_H__*/ diff --git a/src/c/specialFunctions/includes/erfcx.h b/src/c/specialFunctions/includes/erfcx.h new file mode 100644 index 0000000..dd1e442 --- /dev/null +++ b/src/c/specialFunctions/includes/erfcx.h @@ -0,0 +1,37 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __ERFCX_H__ +#define __ERFCX_H__ +#include "types.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "uint8.h" +#include "uint16.h" +#include "int16.h" +#include "erfc.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double derfcxs(double inp1); +void derfcxa(double* inp1, int sizer, int sizec,double* out); +float serfcxs(float inp1); +void serfcxa(float* inp1, int sizer, int sizec, float* out); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__ERFCX_H__*/ diff --git a/src/c/specialFunctions/includes/erfinv.h b/src/c/specialFunctions/includes/erfinv.h new file mode 100644 index 0000000..5d6210c --- /dev/null +++ b/src/c/specialFunctions/includes/erfinv.h @@ -0,0 +1,35 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#ifndef __ERFINV_H__ +#define __ERFINV_H__ +#include "types.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "uint8.h" +#include "uint16.h" +#include "int16.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double derfinvs (double inp1); +float serfinvs (float inp1); +void derfinva(double* inp1, int sizer, int sizec,double* out); +void serfinva(float* inp1, int sizer, int sizec,float* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__ERFINV_H__*/ diff --git a/src/c/specialFunctions/interfaces/int_erf.h b/src/c/specialFunctions/interfaces/int_erf.h new file mode 100644 index 0000000..87f11f9 --- /dev/null +++ b/src/c/specialFunctions/interfaces/int_erf.h @@ -0,0 +1,32 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __INT_ERF_H__ +#define __INT_ERF_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define d0erfd0(in1) derfs(in1) +#define s0erfs0(in1) serfs(in1) +#define d2erfd2(in1,size,out) derfa(in1,size[0],size[1],out) +#define s2erfs2(in1,size,out) serfa(in1,size[0],size[1],out) + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_ERF_H__*/ diff --git a/src/c/specialFunctions/interfaces/int_erfc.h b/src/c/specialFunctions/interfaces/int_erfc.h new file mode 100644 index 0000000..64ae0fa --- /dev/null +++ b/src/c/specialFunctions/interfaces/int_erfc.h @@ -0,0 +1,32 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __INT_ERFC_H__ +#define __INT_ERFC_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define d0erfcd0(in1) derfcs(in1) +#define s0erfcs0(in1) serfcs(in1) +#define d2erfcd2(in1,size,out) derfca(in1,size[0],size[1],out) +#define s2erfcs2(in1,size,out) serfca(in1,size[0],size[1],out) + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_ERFC_H__*/ diff --git a/src/c/specialFunctions/interfaces/int_erfcx.h b/src/c/specialFunctions/interfaces/int_erfcx.h new file mode 100644 index 0000000..89840d4 --- /dev/null +++ b/src/c/specialFunctions/interfaces/int_erfcx.h @@ -0,0 +1,32 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __INT_ERFCX_H__ +#define __INT_ERFCX_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define d0erfcxd0(in1) derfcxs(in1) +#define s0erfcxs0(in1) serfcxs(in1) +#define d2erfcxd2(in1,size,out) derfcxa(in1,size[0],size[1],out) +#define s2erfcs2(in1,size,out) serfca(in1,size[0],size[1],out) + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_ERFCX_H__*/ diff --git a/src/c/specialFunctions/interfaces/int_erfinv.h b/src/c/specialFunctions/interfaces/int_erfinv.h new file mode 100644 index 0000000..f19baa1 --- /dev/null +++ b/src/c/specialFunctions/interfaces/int_erfinv.h @@ -0,0 +1,30 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __INT_ERFINV_H__ +#define __INT_ERFINV_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define d0erfinvd0(in1) derfinvs(in1) +#define s0erfinvs0(in1) serfinvs(in1) +#define d2erfinvd2(in1,size,out) derfinva(in1,size[0],size[1],out) +#define s2erfinvs2(in1,size,out) serfinva(in1,size[0],size[1],out) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_ERFINV_H__*/ diff --git a/src/c/statisticsFunctions/includes/mad.h b/src/c/statisticsFunctions/includes/mad.h new file mode 100644 index 0000000..29032de --- /dev/null +++ b/src/c/statisticsFunctions/includes/mad.h @@ -0,0 +1,42 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#ifndef __MAD_H__ +#define __MAD_H__ + +#include "types.h" +#include "doubleComplex.h" +#include "uint16.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dmada(double* , int ); +void dmadrowa(double*, int, int, double*); +void dmadcola(double*, int, int, double*); + +float smada(float* , int ); +void smadrowa(float*, int, int, float*); +void smadcola(float*, int, int, float*); + +doubleComplex zmada(doubleComplex* , int ); +void zmadrowa(doubleComplex*, int, int, doubleComplex*); +void zmadcola(doubleComplex*, int, int, doubleComplex*); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__MAD_H__*/ diff --git a/src/c/statisticsFunctions/includes/median.h b/src/c/statisticsFunctions/includes/median.h new file mode 100644 index 0000000..accb5df --- /dev/null +++ b/src/c/statisticsFunctions/includes/median.h @@ -0,0 +1,46 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#ifndef __MEDIAN_H__ +#define __MEDIAN_H__ + +#include "types.h" +#include "doubleComplex.h" +#include "uint16.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dmediana(double* , int ); +void dmedianrowa(double*, int, int, double*); +void dmediancola(double*, int, int, double*); + +float smediana(float* , int ); +void smedianrowa(float*, int, int, float*); +void smediancola(float*, int, int, float*); + +uint16 u16mediana(uint16* , int ); +void u16medianrowa(uint16*, int, int, uint16*); +void u16mediancola(uint16*, int, int, uint16*); + +doubleComplex zmediana(doubleComplex* , int ); +void zmedianrowa(doubleComplex*, int, int, doubleComplex*); +void zmediancola(doubleComplex*, int, int, doubleComplex*); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__MATRIX_H__*/ diff --git a/src/c/statisticsFunctions/interfaces/int_mad.h b/src/c/statisticsFunctions/interfaces/int_mad.h new file mode 100644 index 0000000..956323d --- /dev/null +++ b/src/c/statisticsFunctions/interfaces/int_mad.h @@ -0,0 +1,35 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __INT_MAD_H__ +#define __INT_MAD_H__ + + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2madd0(in1, size) dmada(in1, size[0]* size[1]) +#define d2g2madd2(in1, size1, in2, size2, out) (in2[0]== 'r') ? dmadrowa(in1, size1[0], size1[1], out) :dmadcola(in1, size1[0], size1[1], out) + +#define s2mads0(in1, size) smada(in1, size[0]* size[1]) +#define s2g2mads2(in1, size1, in2, size2, out) (in2[0]== 'r') ? smadrowa(in1, size1[0], size1[1], out) :smadcola(in1, size1[0], size1[1], out) + +#define z2madz0(in1, size) zmada(in1, size[0]* size[1]) +#define z2g2madz2(in1, size1, in2, size2, out) (in2[0]== 'r') ? zmadrowa(in1, size1[0], size1[1], out) :zmadcola(in1, size1[0], size1[1], out) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_MAD_H__*/ diff --git a/src/c/statisticsFunctions/interfaces/int_median.h b/src/c/statisticsFunctions/interfaces/int_median.h new file mode 100644 index 0000000..2a21987 --- /dev/null +++ b/src/c/statisticsFunctions/interfaces/int_median.h @@ -0,0 +1,57 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __INT_MEDIAN_H__ +#define __INT_MEDIAN_H__ + + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2mediand0(in1, size) dmediana(in1, size[0]* size[1]) +#define d2g2mediand2(in1, size1, in2, size2, out) (in2[0]== 'r') ? dmedianrowa(in1, size1[0], size1[1], out) :dmediancola(in1, size1[0], size1[1], out) + +#define s2medians0(in1, size) smediana(in1, size[0]* size[1]) +#define s2g2medians2(in1, size1, in2, size2, out) (in2[0]== 'r') ? smedianrowa(in1, size1[0], size1[1], out) :smediancola(in1, size1[0], size1[1], out) + +#define u162medianu160(in1, size) u16mediana(in1, size[0]* size[1]) +#define u162g2medianu162(in1, size1, in2, size2, out) (in2[0]== 'r') ? u16medianrowa(in1, size1[0], size1[1], out) :u16mediancola(in1, size1[0], size1[1], out) + +#define z2medianz0(in1, size) zmediana(in1, size[0]* size[1]) +#define z2g2medianz2(in1, size1, in2, size2, out) (in2[0]== 'r') ? zmedianrowa(in1, size1[0], size1[1], out) :zmediancola(in1, size1[0], size1[1], out) + + +#define s2d0d0matrixs2(in1, size, in2, in3, out ) smatrixa(in1, size[0], size[1], in2, in3, out) +#define s2s0s0matrixs2(in1, size, in2, in3, out ) smatrixa(in1, size[0], size[1], in2, in3, out) +//#define s2u160u160matrixs2(in1, size, in2, in3, out ) smatrixa(in1, size[0], size[1], in2, in3, out) +//#define s2u80u80matrixs2(in1, size, in2, in3, out ) smatrixa(in1, size[0], size[1], in2, in3, out) + +#define u162d0d0matrixu162(in1, size, in2, in3, out ) u16matrixa(in1, size[0], size[1], in2, in3, out) +#define u162s0s0matrixu162(in1, size, in2, in3, out ) u16matrixa(in1, size[0], size[1], in2, in3, out) +//#define s2u160u160matrixs2(in1, size, in2, in3, out ) smatrixa(in1, size[0], size[1], in2, in3, out) +//#define s2u80u80matrixs2(in1, size, in2, in3, out ) smatrixa(in1, size[0], size[1], in2, in3, out) + +#define z2d0d0matrixz2(in1, size, in2, in3, out ) zmatrixa(in1, size[0], size[1], in2, in3, out) +#define z2s0s0matrixz2(in1, size, in2, in3, out ) zmatrixa(in1, size[0], size[1], in2, in3, out) +//#define s2u160u160matrixs2(in1, size, in2, in3, out ) smatrixa(in1, size[0], size[1], in2, in3, out) +//#define s2u80u80matrixs2(in1, size, in2, in3, out ) smatrixa(in1, size[0], size[1], in2, in3, out) + + + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_MATRIX_H__*/ diff --git a/src/c/statisticsFunctions/mad/dmada.c b/src/c/statisticsFunctions/mad/dmada.c new file mode 100644 index 0000000..907f78a --- /dev/null +++ b/src/c/statisticsFunctions/mad/dmada.c @@ -0,0 +1,38 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "mad.h" +#include "types.h" +#include "uint16.h" +#include "mean.h" +#include "addition.h" +#include "abs.h" + +double dmada(double *in, int size) +{ + double fin = 0; double mean; + + mean= dmeana(in, size); + + for(int i=0; i< size; i++) + { + + fin = dadds(fin, dabss(mean-in[i])); + + } + +fin= fin/size; + + + return fin; +} diff --git a/src/c/statisticsFunctions/mad/dmadcola.c b/src/c/statisticsFunctions/mad/dmadcola.c new file mode 100644 index 0000000..381f85c --- /dev/null +++ b/src/c/statisticsFunctions/mad/dmadcola.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "mad.h" +#include "types.h" +#include "uint16.h" +#include "mean.h" +#include "addition.h" +#include "abs.h" + +void dmadcola(double *in, int row, int col, double* out) +{ + double inter[col]; + + +for(int i=0; i< row; i++) + { + for(int j=0 ; j< col; j++) + { + inter[j]= in[i+ (j*row)]; + + } + out[i]= dmada( inter, col); + + } +} diff --git a/src/c/statisticsFunctions/mad/dmadrowa.c b/src/c/statisticsFunctions/mad/dmadrowa.c new file mode 100644 index 0000000..2b47ba0 --- /dev/null +++ b/src/c/statisticsFunctions/mad/dmadrowa.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "mad.h" +#include "types.h" +#include "uint16.h" +#include "mean.h" +#include "addition.h" +#include "abs.h" + +void dmadrowa(double *in, int row, int col, double* out) +{ + double inter[row]; + +for(int i=0; i< col; i++) + { + for(int j=0 ; j< row; j++) + { + inter[j]= in[j+ (i*row)]; + + } + out[i]= dmada( inter, row); + + } + +} diff --git a/src/c/statisticsFunctions/mad/smada.c b/src/c/statisticsFunctions/mad/smada.c new file mode 100644 index 0000000..241e337 --- /dev/null +++ b/src/c/statisticsFunctions/mad/smada.c @@ -0,0 +1,38 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "mad.h" +#include "types.h" +#include "uint16.h" +#include "mean.h" +#include "addition.h" +#include "abs.h" + +float smada(float *in, int size) +{ + float fin = 0; float mean; + + mean= smeana(in, size); + + for(int i=0; i< size; i++) + { + + fin = sadds(fin, sabss(mean-in[i])); + + } + +fin= fin/size; + + + return fin; +} diff --git a/src/c/statisticsFunctions/mad/smadcola.c b/src/c/statisticsFunctions/mad/smadcola.c new file mode 100644 index 0000000..c6f5e75 --- /dev/null +++ b/src/c/statisticsFunctions/mad/smadcola.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "mad.h" +#include "types.h" +#include "uint16.h" +#include "mean.h" +#include "addition.h" +#include "abs.h" + +void smadcola(float* in, int row, int col, float* out) +{ + float inter[col]; + + +for(int i=0; i< row; i++) + { + for(int j=0 ; j< col; j++) + { + inter[j]= in[i+ (j*row)]; + + } + out[i]= smada( inter, col); + + } +} diff --git a/src/c/statisticsFunctions/mad/smadrowa.c b/src/c/statisticsFunctions/mad/smadrowa.c new file mode 100644 index 0000000..3fbd917 --- /dev/null +++ b/src/c/statisticsFunctions/mad/smadrowa.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "mad.h" +#include "types.h" +#include "uint16.h" +#include "mean.h" +#include "addition.h" +#include "abs.h" + +void smadrowa(float *in, int row, int col, float* out) +{ + float inter[row]; + +for(int i=0; i< col; i++) + { + for(int j=0 ; j< row; j++) + { + inter[j]= in[j+ (i*row)]; + + } + out[i]= smada( inter, row); + + } + +} diff --git a/src/c/statisticsFunctions/mad/zmada.c b/src/c/statisticsFunctions/mad/zmada.c new file mode 100644 index 0000000..9531e3b --- /dev/null +++ b/src/c/statisticsFunctions/mad/zmada.c @@ -0,0 +1,40 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "mad.h" +#include "types.h" +#include "doubleComplex.h" +#include "mean.h" +#include "addition.h" +#include "abs.h" +#include "subtraction.h" +#include "division.h" + +doubleComplex zmada(doubleComplex *in, int size) +{ + doubleComplex fin = DoubleComplex(0,0); doubleComplex mean; + + mean= zmeana(in, size); + + for(int i=0; i< size; i++) + { + + fin = zadds(fin, zabss(zdiffs(mean,in[i]))); + + } + +fin= zrdivs(fin,size); + + + return fin; +} diff --git a/src/c/statisticsFunctions/mad/zmadcola.c b/src/c/statisticsFunctions/mad/zmadcola.c new file mode 100644 index 0000000..a70841b --- /dev/null +++ b/src/c/statisticsFunctions/mad/zmadcola.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "mad.h" +#include "types.h" +#include "doubleComplex.h" +#include "mean.h" +#include "addition.h" +#include "abs.h" + +void zmadcola(doubleComplex* in, int row, int col, doubleComplex* out) +{ + doubleComplex inter[col]; + + +for(int i=0; i< row; i++) + { + for(int j=0 ; j< col; j++) + { + inter[j]= in[i+ (j*row)]; + + } + out[i]= zmada( inter, col); + + } +} diff --git a/src/c/statisticsFunctions/mad/zmadrowa.c b/src/c/statisticsFunctions/mad/zmadrowa.c new file mode 100644 index 0000000..c279322 --- /dev/null +++ b/src/c/statisticsFunctions/mad/zmadrowa.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "mad.h" +#include "types.h" +#include "doubleComplex.h" +#include "mean.h" +#include "addition.h" +#include "abs.h" + +void zmadrowa(doubleComplex* in, int row, int col, doubleComplex* out) +{ + doubleComplex inter[row]; + +for(int i=0; i< col; i++) + { + for(int j=0 ; j< row; j++) + { + inter[j]= in[j+ (i*row)]; + + } + out[i]= zmada( inter, row); + + } + +} diff --git a/src/c/statisticsFunctions/median/dmediana.c b/src/c/statisticsFunctions/median/dmediana.c new file mode 100644 index 0000000..cb2463c --- /dev/null +++ b/src/c/statisticsFunctions/median/dmediana.c @@ -0,0 +1,58 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "median.h" +#include "types.h" +#include "uint16.h" + +double dmediana(double *in, int size) +{ + double a; double fin; + + + for (int i = 0; i < size; ++i) + + { + + for (int j = i + 1; j < size; ++j) + + { + + if (in[i] > in[j]) + + { + + a = in[i]; + + in[i] = in[j]; + + in[j] = a; + + } + + } + + } + + + if(size%2 ==0) + { + fin= (in[size/2]+ in[(size/2)-1])/2; + } + else + { + fin= in[(size-1)/2]; + } + + return fin; +} diff --git a/src/c/statisticsFunctions/median/dmediancola.c b/src/c/statisticsFunctions/median/dmediancola.c new file mode 100644 index 0000000..b3ff4fb --- /dev/null +++ b/src/c/statisticsFunctions/median/dmediancola.c @@ -0,0 +1,35 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "median.h" +#include "types.h" +#include "uint16.h" + +void dmediancola(double *in, int row, int col, double* out) +{ + double inter[col]; + + +for(int i=0; i< row; i++) + { + for(int j=0 ; j< col; j++) + { + inter[j]= in[i+ (j*row)]; + + } + out[i]= dmediana( inter, col); + + } + + +} diff --git a/src/c/statisticsFunctions/median/dmedianrowa.c b/src/c/statisticsFunctions/median/dmedianrowa.c new file mode 100644 index 0000000..4b5879c --- /dev/null +++ b/src/c/statisticsFunctions/median/dmedianrowa.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "median.h" +#include "types.h" +#include "uint16.h" + +void dmedianrowa(double *in, int row, int col, double* out) +{ + double inter[row]; + + + +for(int i=0; i< col; i++) + { + for(int j=0 ; j< row; j++) + { + inter[j]= in[j+ (i*row)]; + + } + out[i]= dmediana( inter, row); + + } + + +} diff --git a/src/c/statisticsFunctions/median/smediana.c b/src/c/statisticsFunctions/median/smediana.c new file mode 100644 index 0000000..9e86b77 --- /dev/null +++ b/src/c/statisticsFunctions/median/smediana.c @@ -0,0 +1,57 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "median.h" +#include "types.h" +#include "uint16.h" + +float smediana(float *in, int size) +{ + float a; float fin; + + + for (int i = 0; i < size; ++i) + + { + + for (int j = i + 1; j < size; ++j) + + { + + if (in[i] > in[j]) + + { + + a = in[i]; + + in[i] = in[j]; + + in[j] = a; + + } + + } + + } + + if(size%2 ==0) + { + fin= (in[size/2]+ in[(size/2)-1])/2; + } + else + { + fin= in[(size-1)/2]; + } + + return fin; +} diff --git a/src/c/statisticsFunctions/median/smediancola.c b/src/c/statisticsFunctions/median/smediancola.c new file mode 100644 index 0000000..2fc4eaf --- /dev/null +++ b/src/c/statisticsFunctions/median/smediancola.c @@ -0,0 +1,35 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "median.h" +#include "types.h" +#include "uint16.h" + +void smediancola(float *in, int row, int col, float* out) +{ + float inter[col]; + + +for(int i=0; i< row; i++) + { + for(int j=0 ; j< col; j++) + { + inter[j]= in[i+ (j*row)]; + + } + out[i]= smediana( inter, col); + + } + + +} diff --git a/src/c/statisticsFunctions/median/smedianrowa.c b/src/c/statisticsFunctions/median/smedianrowa.c new file mode 100644 index 0000000..aab5938 --- /dev/null +++ b/src/c/statisticsFunctions/median/smedianrowa.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "median.h" +#include "types.h" +#include "uint16.h" + +void smedianrowa(float *in, int row, int col, float* out) +{ + float inter[row]; + + + +for(int i=0; i< col; i++) + { + for(int j=0 ; j< row; j++) + { + inter[j]= in[j+ (i*row)]; + + } + out[i]= smediana( inter, row); + + } + + +} diff --git a/src/c/statisticsFunctions/median/u16mediana.c b/src/c/statisticsFunctions/median/u16mediana.c new file mode 100644 index 0000000..b45c530 --- /dev/null +++ b/src/c/statisticsFunctions/median/u16mediana.c @@ -0,0 +1,57 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "median.h" +#include "types.h" +#include "uint16.h" + +uint16 u16mediana(uint16 *in, int size) +{ + uint16 a; uint16 fin; + + + for (int i = 0; i < size; ++i) + + { + + for (int j = i + 1; j < size; ++j) + + { + + if (in[i] > in[j]) + + { + + a = in[i]; + + in[i] = in[j]; + + in[j] = a; + + } + + } + + } + + if(size%2 ==0) + { + fin= (in[size/2]+ in[(size/2)-1])/2; + } + else + { + fin= in[(size-1)/2]; + } + + return fin; +} diff --git a/src/c/statisticsFunctions/median/u16mediancola.c b/src/c/statisticsFunctions/median/u16mediancola.c new file mode 100644 index 0000000..77952a3 --- /dev/null +++ b/src/c/statisticsFunctions/median/u16mediancola.c @@ -0,0 +1,35 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "median.h" +#include "types.h" +#include "uint16.h" + +void u16mediancola(uint16 *in, int row, int col, uint16* out) +{ + uint16 inter[col]; + + +for(int i=0; i< row; i++) + { + for(int j=0 ; j< col; j++) + { + inter[j]= in[i+ (j*row)]; + + } + out[i]= u16mediana( inter, col); + + } + + +} diff --git a/src/c/statisticsFunctions/median/u16medianrowa.c b/src/c/statisticsFunctions/median/u16medianrowa.c new file mode 100644 index 0000000..8e5b98e --- /dev/null +++ b/src/c/statisticsFunctions/median/u16medianrowa.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "median.h" +#include "types.h" +#include "uint16.h" + +void u16medianrowa(uint16 *in, int row, int col, uint16* out) +{ + uint16 inter[row]; + + + +for(int i=0; i< col; i++) + { + for(int j=0 ; j< row; j++) + { + inter[j]= in[j+ (i*row)]; + + } + out[i]= u16mediana( inter, row); + + } + + +} diff --git a/src/c/statisticsFunctions/median/zmediana.c b/src/c/statisticsFunctions/median/zmediana.c new file mode 100644 index 0000000..32726e7 --- /dev/null +++ b/src/c/statisticsFunctions/median/zmediana.c @@ -0,0 +1,64 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "median.h" +#include "types.h" +#include "uint16.h" +#include "doubleComplex.h" +#include "addition.h" +#include "division.h" +#include "abs.h" + +doubleComplex zmediana(doubleComplex *in, int size) +{ + doubleComplex a; doubleComplex fin; doubleComplex middle; + + + for (int i = 0; i < size; ++i) + + { + + for (int j = i + 1; j < size; ++j) + + { + + if (zabss(in[i]) > zabss(in[j])) + + { + + a = in[i]; + + in[i] = in[j]; + + in[j] = a; + + } + + } + + } + + + + if(size%2 ==0) + { + middle= zadds(in[size/2], in[(size/2)-1]); + fin= zrdivs(middle, DoubleComplex(2,0)); + } + else + { + fin= in[(size-1)/2]; + } + + return fin; +} diff --git a/src/c/statisticsFunctions/median/zmediancola.c b/src/c/statisticsFunctions/median/zmediancola.c new file mode 100644 index 0000000..d709d98 --- /dev/null +++ b/src/c/statisticsFunctions/median/zmediancola.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "median.h" +#include "types.h" +#include "uint16.h" +#include "doubleComplex.h" + +void zmediancola(doubleComplex *in, int row, int col, doubleComplex * out) +{ + doubleComplex inter[col]; + + +for(int i=0; i< row; i++) + { + for(int j=0 ; j< col; j++) + { + inter[j]= in[i+ (j*row)]; + + } + out[i]= zmediana( inter, col); + + } + + +} diff --git a/src/c/statisticsFunctions/median/zmedianrowa.c b/src/c/statisticsFunctions/median/zmedianrowa.c new file mode 100644 index 0000000..ab2e0d4 --- /dev/null +++ b/src/c/statisticsFunctions/median/zmedianrowa.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "median.h" +#include "types.h" +#include "uint16.h" +#include "doubleComplex.h" + +void zmedianrowa(doubleComplex *in, int row, int col, doubleComplex* out) +{ + doubleComplex inter[row]; + + + +for(int i=0; i< col; i++) + { + for(int j=0 ; j< row; j++) + { + inter[j]= in[j+ (i*row)]; + + } + out[i]= zmediana( inter, row); + + } + + +} diff --git a/src/c/string/ascii/gasciia.c b/src/c/string/ascii/gasciia.c index ec11d6e..5fe95e0 100644 --- a/src/c/string/ascii/gasciia.c +++ b/src/c/string/ascii/gasciia.c @@ -14,12 +14,12 @@ into its ascii equivalent. */ #include "ascii.h" -void gasciia(char *str,int size,int* oup) +void gasciia(char *str,int size,uint8* oup) { int i; for(i=0;i<size;i++) { - *(oup+i)=(int)str[i]; + *(oup+i)=str[i]; } } diff --git a/src/c/string/disp/zdispa.c b/src/c/string/disp/zdispa.c index bc71de4..94b24e9 100644 --- a/src/c/string/disp/zdispa.c +++ b/src/c/string/disp/zdispa.c @@ -16,7 +16,7 @@ double zdispa (doubleComplex* in, int rows, int columns){ int i = 0,j = 0; for (i = 0; i < rows; ++i) { - for (j=0;j<columns;j++) printf(" %1.20lf + %1.20lfi " ,zreals(in[i+j*rows]) ,zimags(in[i+j*rows])); + for (j=0;j<columns;j++) printf(" %e + %ei " ,zreals(in[i+j*rows]) ,zimags(in[i+j*rows])); printf("\n"); } return 0; diff --git a/src/c/string/disp/zdisps.c b/src/c/string/disp/zdisps.c index c4ec137..4a040cd 100644 --- a/src/c/string/disp/zdisps.c +++ b/src/c/string/disp/zdisps.c @@ -14,6 +14,6 @@ double zdisps (doubleComplex in) { - printf(" %1.20f + %1.20fi \n" ,zreals(in) ,zimags(in)); + printf(" %e + %ei \n" ,zreals(in) ,zimags(in)); return 0; } diff --git a/src/c/string/includes/ascii.h b/src/c/string/includes/ascii.h index fcf969d..39aeb83 100644 --- a/src/c/string/includes/ascii.h +++ b/src/c/string/includes/ascii.h @@ -17,7 +17,7 @@ extern "C" { #endif -void gasciia(char* str,int size,int* oup); +void gasciia(char* str,int size,uint8* oup); void dasciia(double* inp,int size,char* oup); #ifdef __cplusplus diff --git a/src/c/string/includes/disp.h b/src/c/string/includes/disp.h index 88764f2..7b46390 100644 --- a/src/c/string/includes/disp.h +++ b/src/c/string/includes/disp.h @@ -125,6 +125,7 @@ EXTERN_STRING double ddisph (double *in, int rows, int cols, int levels); EXTERN_STRING double g2dispd0(char *array,int* tmparraysize); + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/src/c/string/interfaces/int_disp.h b/src/c/string/interfaces/int_disp.h index 3bb7852..2610332 100644 --- a/src/c/string/interfaces/int_disp.h +++ b/src/c/string/interfaces/int_disp.h @@ -51,7 +51,9 @@ #define d3disp(in,size) ddisph(in,size[0],size[1],size[2]) -#define g2disp(in, size) printf("%s\n",in) +#define g2disp(in, size) printf("%s\n", in) + +#define g0disp(in) printf("%c\n", in) #endif /* __INT_DISP_H__ */ diff --git a/src/c/string/strcspn/gstrcspna.c b/src/c/string/strcspn/gstrcspna.c index 4dcdcdf..91de8af 100644 --- a/src/c/string/strcspn/gstrcspna.c +++ b/src/c/string/strcspn/gstrcspna.c @@ -14,37 +14,28 @@ #include "strcspn.h" uint8 gstrcspna(char *str1,int size1,char *str2,int size2) { - int ind,i,j;; - - for(i=0;i<=size1;i++) + + uint8 ind=size1+1; + int l,m; + for(m=0;m<size2;m++) { - for(j=0;j<=size2;j++) - { - if(str2[j]==str1[i]) + int tp; + for(l=0;l<size1;l++) { - ind=j; - break; + if(str2[m]==str1[l]) + { + tp=l; + if(ind>tp) + { + ind=tp; + } + } } - } } - return (ind+1); -} -/*int main() -{ - int n1,n2; - char inp1[100000],inp2[100000]; - printf("Enter the length of the first string"); - scanf("%d",&n1); - for(int i=0;i<=(n1+1);i++) - { - scanf("%c",&inp1[i]); - } - printf("Enter the length of the second string"); - scanf("%d",&n2 ); - for(int j=0;j<=(n2+1);j++) + if(ind==size1+1) { - scanf("%c",&inp2[j]); + ind=size1; } - strcspnfn(inp1,n1+1,inp2,n2+1); + return ind; } -*/ + diff --git a/src/c/type/doubleComplex.h b/src/c/type/doubleComplex.h index 4be0d7d..15bc268 100644 --- a/src/c/type/doubleComplex.h +++ b/src/c/type/doubleComplex.h @@ -45,6 +45,21 @@ typedef struct double_complex doubleComplex; /* ** } */ +#elif defined(ARDUINO) +/* +** Hand made Double Complex definition +** { +*/ +struct double_complex +{ + double real; + double imag; +}; + +typedef struct double_complex doubleComplex; +/* +** } +*/ #else /* ** Standard C99 Complex @@ -57,7 +72,6 @@ typedef double complex doubleComplex; ** } */ #endif - #ifdef __cplusplus extern "C" { #endif diff --git a/src/c/type/floatComplex.h b/src/c/type/floatComplex.h index fe35ca4..ba725c9 100644 --- a/src/c/type/floatComplex.h +++ b/src/c/type/floatComplex.h @@ -44,6 +44,21 @@ struct float_complex typedef struct float_complex floatComplex; /* ** } +*/
+#elif defined(ARDUINO)
+/* +** Hand made Float Complex definition +** { +*/ +struct float_complex +{ + float real; + float imag; +}; + +typedef struct float_complex floatComplex; +/* +** } */ #else /* diff --git a/src/c/type/types.h b/src/c/type/types.h index a76bf30..ee5c899 100644 --- a/src/c/type/types.h +++ b/src/c/type/types.h @@ -4,7 +4,7 @@ /*****************************************************************************/ /* TYPE DEFINITIONS */ /*****************************************************************************/ -typedef unsigned char boolean; +/*typedef unsigned char boolean;*/ typedef unsigned char uint8; typedef unsigned short uint16; diff --git a/src/python/serverWP.py b/src/python/serverWP.py new file mode 100755 index 0000000..c41c25f --- /dev/null +++ b/src/python/serverWP.py @@ -0,0 +1,203 @@ +import wiringpi as wp +import socket +import subprocess as sp +import logging +import traceback +import sys +import RPi.GPIO as GPIO + +logging.basicConfig(filename='log.txt',level=logging.DEBUG) +logger=logging.getLogger(__name__) +pinNum=0 +#wp.wiringPiSetup() +GPIO.setmode(GPIO.BCM) + +commands={ +'cls':'s.close()\n\ta="Connection Closed"\n\tgo=0', +'i2c':'if sys.version_info<(3,0):\n\t\ta=sp.check_output(inputList[0].split())\n\telse:\n\t\ta=sp.run(inputList[0].split(),stdout=sp.PIPE).stdout.decode("utf-8")', +'anR':'a=wp.analogRead(int(inputList[0]))', +'anW':'a=wp.analogWrite(int(inputList[0]),int(inputList[1]))', +'bRv':'a=wp.piBoardRev()', +'BtR':'a=wp.digitalReadByte()', +'BtW':'a=wp.digitalWriteByte(int(inputList[0]))', +'CR1':'a=wp.wiringPiI2CRead(int(inputList[0]))', +'CR2':'a=wp.wiringPiI2CReadReg8(int(inputList[0]),int(inputList[1]))', +'CR3':'a=wp.wiringPiI2CReadReg16(int(inputList[0]),int(inputList[1]))', +'CSe':'a=wp.wiringPiI2CSetup(int(inputList[0]))', +'CSI':'a=wp.wiringPiI2CSetupInterface(inputList[0],int(inputList[1]))', +'CW1':'a=wp.wiringPiI2CWrite(int(inputList[0]),int(inputList[1]))', +'CW2':'a=wp.wiringPiI2CWriteReg8(int(inputList[0]),int(inputList[1]),int(inputList[2]))', +'CW3':'a=wp.wiringPiI2CWriteReg16(int(inputList[0]),int(inputList[1]),int(inputList[2]))', +'deS':'a=wp.delay(int(inputList[0]))', +'deU':'a=wp.delayMicroseconds(int(inputList[0]))', +'diR':'a=wp.digitalRead(int(inputList[0]))', +'diW':'a=wp.digitalWrite(int(inputList[0]),int(inputList[1]))', +'dsS':'a=wp.ds1302Setup(int(inputList[0]),int(inputList[1]),int(inputList[2]),)', +'dsR':'a=wp.ds1302rtcRead(int(inputList[0]))', +'dsW':'a=wp.ds1302rtcWrite(int(inputList[0]),int(inputList[1]))', +'dsr':'a=wp.ds1302ramRead(int(inputList[0]))', +'dsw':'a=wp.ds1302ramWrite(int(inputList[0]),int(inputList[1]))', +'dsc':'a=wp.ds1302clockRead(int(inputList[0]))', +'dsC':'a=wp.ds1302clockWrite(int(inputList[0]))', +'dst':'a=wp.ds1302trickleCharge(int(inputList[0]),int(inputList[1]))', +'gAS':'a=wp.gertboardAnalogSetup(int(inputList[0]))', +'gAR':'a=wp.gertboardAnalogRead(int(inputList[0]))', +'gAt':'a=wp.getAlt(int(inputList[0]))', +'gAW':'a=wp.gertboardAnalogWrite(int(inputList[0]),int(inputList[1]))', +'gSS':'a=wp.gertboardSPISetup()', +'Int':'if pinNum==1:\n\t\tpin=wp.wpiPinToGpio(int(inputList[0]))\n\telif pinNum==2:\n\t\tpin=int(inputList[0])\n\telif pinNum==3:\n\t\tpin=wp.physPinToGpio(int(inputList[0]))\n\tGPIO.setup(pin,GPIO.IN,pull_up_down=GPIO.PUD_DOWN)\n\tif int(inputList[1])==-1:\n\t\ta=GPIO.wait_for_edge(pin,GPIO.RISING)\n\telse:\n\t\ta=GPIO.wait_for_edge(pin,GPIO.RISING,timeout=int(inputList[1]))\n\tif type(a)==int:\n\t\ta=1\n\telse:\n\t\ta=0', +#'a=wp.waitForInterrupt(int(inputList[0]),int(inputList[1]))', +#'ISR':'a=wp.wiringPiISR(int(inputList[0]),int(inputList[1]),inputList[2])', +'lCB':'a=wp.lcdCursorBlink(int(inputList[0]),int(inputList[1]))', +'lCD':'a=wp.lcdCharDef(int(inputList[0]),int(inputList[1]),[int(inputList[2]),int(inputList[3]),int(inputList[4]),int(inputList[5]),int(inputList[6]),int(inputList[7]),int(inputList[8]),int(inputList[9])])', +'lCl':'a=wp.lcdClear(int(inputList[0]))', +'lCu':'a=wp.lcdCursor(int(inputList[0]),int(inputList[1]))', +'lDs':'a=wp.lcdDisplay(int(inputList[0]),int(inputList[1]))', +'lHo':'a=wp.lcdHome(int(inputList[0]))', +'lIn':'a=wp.lcdInit(int(inputList[0]),int(inputList[1]),int(inputList[2]),int(inputList[3]),int(inputList[4]),int(inputList[5]),int(inputList[6]),int(inputList[7]),int(inputList[8]),int(inputList[9]),int(inputList[10]),int(inputList[11]),int(inputList[12]))', +'lok':'a=wp.piLock(int(inputList[0]))', +'lPc':'a=wp.lcdPutchar(int(inputList[0]),int(inputList[1]))', +'lPo':'a=wp.lcdPosition(int(inputList[0]),int(inputList[1]),int(inputList[2]))', +'lPf':'a=wp.lcdPrintf(int(inputList[0]),inputList[1])', +'lPu':'a=wp.lcdPuts(int(inputList[0]),inputList[1])', +'lSC':'a=wp.lcdSendCommand(int(inputList[0]),inputList[1])', +'Lse':'a=wp.lcd128x64setup()', +'Lup':'a=wp.lcd128x64update()', +'LOr':'a=wp.lcd128x64setOrigin(int(inputList[0]),int(inputList[1]))', +'LOn':'a=wp.lcd128x64setOrientation(int(inputList[0]))', +#'LCo':'a=wp.lcd128x64orientCoord(int(inputList[0]),int(inputList[1]))', +#'LSS':'a=wp.lcd128x64ScreenSize(int(inputList[0]),int(inputList[1]))', +'Lpo':'a=wp.lcd128x64point(int(inputList[0]),int(inputList[1]),int(inputList[2]))', +'Lli':'a=wp.lcd128x64line(int(inputList[0]),int(inputList[1]),int(inputList[2]),int(inputList[3]),int(inputList[4]))', +'LlT':'a=wp.lcd128x64lineTo(int(inputList[0]),int(inputList[1]),int(inputList[2]))', +'Lre':'a=wp.lcd128x64rectangle(int(inputList[0]),int(inputList[1]),int(inputList[2]),int(inputList[3]),int(inputList[4]),int(inputList[5]))', +'Lci':'a=wp.lcd128x64circle(int(inputList[0]),int(inputList[1]),int(inputList[2]),int(inputList[0]),int(inputList[3]),int(inputList[4]))', +'Lel':'a=wp.lcd128x64ellipse(int(inputList[0]),int(inputList[1]),int(inputList[2]),int(inputList[3]),int(inputList[4]),int(inputList[5]))', +'Lpc':'a=wp.lcd128x64putchar(int(inputList[0]),int(inputList[1]),int(inputList[2]),int(inputList[3]),int(inputList[4]),int(inputList[5]))', +'LPu':'a=wp.lcd128x64puts(int(inputList[0]),int(inputList[1]),inputList[2],int(inputList[3]),int(inputList[4]))', +'LCl':'a=wp.lcd128x64clear(int(inputList[0]))', +'mic':'a=wp.micros()', +'mil':'a=wp.millis()', +'mp6':'a=wp.mcp23016Setup(int(inputList[0]),int(inputList[1]))', +'mp7':'a=wp.mcp23017Setup(int(inputList[0]),int(inputList[1]))', +'mp8':'a=wp.mcp23008Setup(int(inputList[0]),int(inputList[1]))', +#'mp2':'a=wp.mcp3002Setup(int(inputList[0]),int(inputList[1]))', +#'mp4':'a=wp.mcp3004Setup(int(inputList[0]),int(inputList[1]))', +#'mp3':'a=wp.mcp3422Setup(int(inputList[0]),int(inputList[1]),int(inputList[2]),int(inputList[3]))', +#'mp0':'a=wp.mcp4802Setup(int(inputList[0]),int(inputList[1]))', +'ms7':'a=wp.mcp23s17Setup(int(inputList[0]),int(inputList[1]),int(inputList[2]))', +'ms8':'a=wp.mcp23s08Setup(int(inputList[0]),int(inputList[1]),int(inputList[2]))', +'mxR':'a=wp.maxDetectRead(int(inputList[0]),inputList[1])', +'mx3':'a=wp.max31855Setup(int(inputList[0]),int(inputList[1]))', +'mx5':'a=wp.max5322Setup(int(inputList[0]),int(inputList[1]))', +'NES':'a=wp.setupNesJoystick(int(inputList[0]),int(inputList[1]),int(inputList[2]))', +'NER':'a=wp.readNesJoystick(int(inputList[0]))', +'pDr':'a=wp.setPadDrive(int(inputList[0]),int(inputList[1]))', +'pf7':'a=wp.pcf8574Setup(int(inputList[0]),int(inputList[1]))', +'pf9':'a=wp.pcf8591Setup(int(inputList[0]),int(inputList[1]))', +'pG1':'a=wp.piGlow1(int(inputList[0]),int(inputList[1]),int(inputList[2]))', +'pGL':'a=wp.piGlowLeg(int(inputList[0]),int(inputList[1]))', +'pGR':'a=wp.piGlowRing(int(inputList[0]),int(inputList[1]))', +'pGS':'a=wp.piGlowSetup(int(inputList[0]))', +'PhS':'a=wp.scrollPhatSetup()', +'PhU':'a=wp.scrollPhatUpdate()', +'PhC':'a=wp.scrollPhatClear()', +'Php':'a=wp.scrollPhatPoint(int(inputList[0]),int(inputList[1]),int(inputList[2]))', +'PhL':'a=wp.scrollPhatLine(int(inputList[0]),int(inputList[1]),int(inputList[2]),int(inputList[3]),int(inputList[4]))', +'PhT':'a=wp.scrollPhatLineTo(int(inputList[0]),int(inputList[1]),int(inputList[2]))', +'PhR':'a=wp.scrollPhatRectangle(int(inputList[0]),int(inputList[1]),int(inputList[2]),int(inputList[3]),int(inputList[4]),int(inputList[5]),)', +'Phc':'a=wp.scrollPhatPutchar(int(inputList[0]))', +'PhP':'a=wp.scrollPhatPuts(inputList[0])', +'Phf':'a=wp.scrollPhatPrintf(inputList[0])', +'Phs':'a=wp.scrollPhatPrintSpeed(int(inputList[0]))', +'PhI':'a=wp.scrollPhatIntensity(int(inputList[0]),)', +'plC':'a=wp.pullUpDnControl(int(inputList[0]),int(inputList[1]))', +'pMA':'a=wp.pinModeAlt(int(inputList[0]),int(inputList[1]))', +'pN0':'if pinNum==0:\n\t\ta=wp.wiringPiSetup()\n\t\tpinNum=1\n\telse:\n\t\ta="RPI_pinNumbering has already been called once. Close and restart the connection to change the numbering sequence."', +'pN1':'if pinNum==0:\n\t\ta=wp.wiringPiSetupGpio()\n\t\tpinNum=2\n\telse:\n\t\ta="RPI_pinNumbering has already been called once. Close and restart the connection to change the numbering sequence."', +'pN2':'if pinNum==0:\n\t\ta=wp.wiringPiSetupPhys()\n\t\tpinNum=3\n\telse:\n\t\ta="RPI_pinNumbering has already been called once. Close and restart the connection to change the numbering sequence."', +'pN3':'if pinNum==0:\n\t\ta=wp.wiringPiSetupSys()\n\t\tpinNum=4\n\telse:\n\t\ta="RPI_pinNumbering has already been called once. Close and restart the connection to change the numbering sequence."()', +'pnM':'a=wp.pinMode(int(inputList[0]),int(inputList[1]))', +'pri':'a=wp.PiHiPri(int(inputList[0]))', +'ptG':'a=wp.physPinToGpio(int(inputList[0]))', +'pwC':'a=wp.pwmSetClock(int(inputList[0]))', +'pwG':'a=wp.wpiPinToGpio(int(inputList[0]))', +'pwM':'a=wp.pwmSetMode(int(inputList[0]))', +'pwR':'a=wp.pwmSetRange(int(inputList[0]))', +'pwT':'a=wp.pwmToneWrite(int(inputList[0]),int(inputList[1]))', +'pwW':'a=wp.pwmWrite(int(inputList[0]),int(inputList[1]))', +'sCl':'a=wp.serialClose(int(inputList[0]))', +'sDA':'a=wp.serialDataAvail(int(inputList[0]))', +'sFl':'a=wp.serialFlush(int(inputList[0]))', +'sGc':'a=wp.serialGetchar(int(inputList[0]))', +'shI':'a=wp.shiftIn(int(inputList[0]),int(inputList[1]),int(inputList[2]))', +'shO':'a=wp.shiftOut(int(inputList[0]),int(inputList[1]),int(inputList[2]),int(inputList[3]))', +'sn3':'a=wp.sn3218Setup(int(inputList[0]))', +'sOp':'a=wp.serialOpen(inputList[0],int(inputList[1]))', +'sPc':'a=wp.serialPutchar(int(inputList[0]),inputList[1])', +'sPC':'a=wp.softPwmCreate(int(inputList[0]),int(inputList[1]),int(inputList[2]))', +'SPD':'a=wp.wiringPiSPIDataRW(int(inputList[0]),inputList[1])', +'sPf':'a=wp.serialPrintf(int(inputList[0]),inputList[1])', +'SPF':'a=wp.wiringPiSPIGetFd(int(inputList[0]))', +'SPM':'a=wp.wiringPiSPISetupMode(int(inputList[0]),int(inputList[1]),int(inputList[2]))', +'SPS':'a=wp.wiringPiSPISetup(int(inputList[0]),int(inputList[1]))', +'sPs':'a=wp.serialPuts(int(inputList[0]),inputList[1])', +'sPS':'a=wp.softPwmStop(int(inputList[0]))', +'sPW':'a=wp.softPwmWrite(int(inputList[0]),int(inputList[1]))', +'sSS':'a=wp.softServoSetup(int(inputList[0]),int(inputList[1]),int(inputList[2]),int(inputList[3]),int(inputList[4]),int(inputList[5]),int(inputList[6]),int(inputList[7]))', +'sSW':'a=wp.softServoWrite(int(inputList[0]),int(inputList[1]))', +'sr5':'a=wp.sr595Setup(int(inputList[0]),int(inputList[1]),int(inputList[2]),int(inputList[3]),int(inputList[4]))', +'sTC':'a=wp.softToneCreate(int(inputList[0]))', +'sTS':'a=wp.softToneStop(int(inputList[0]))', +'sTW':'a=wp.softToneWrite(int(inputList[0]),int(inputList[1]))', +'thC':'a=wp.piThreadCreate(inputList[0])', +'unl':'a=wp.piUnlock(int(inputList[0]))', +'wtG':'a=wp.wpiPinToGpio(int(inputList[0]))', +#'rRT':'a=wp.readRHT03(int(inputList[0]),int(inputList[1]),inputList[2])', +'drc':'a=wp.drcSetupSerial(int(inputList[0]),int(inputList[1]),inputList[2],inputList[3])', +'ads':'a=wp.ads1115Setup(int(inputList[0]),int(inputList[1]))', +'wpF':'a=wp.wiringPiFailure(int(inputList[0]),inputList[1])', +'wpN':'a=wp.wiringPiFindNode(int(inputList[0]))', +'wpn':'a=wp.wiringPiNewNode(int(inputList[0]),int(inputList[1]))', +#'pBI':'a=wp.piBoardId()', +'gCS':'a=wp.gpioClockSet(int(inputList[0]),int(inputList[1]))', +#'':'a=wp.', +#'ISR':'if pinNum==1:\n\t\tpin=wp.wpiPinToGpio(29)\n\telif pinNum==2:\n\t\tpin=int(inputList[0])\n\telif pinNum==3:\n\t\t pin=wp.physPinToGpio(int(inputList[0]))\n\tGPIO.setup(pin,GPIO.IN,pull_up_down=inputList[2])\n\tGPIO.add_event_detect(pin,exec(inputList[1]),send2Client)', +} + +s=socket.socket(socket.AF_INET, socket.SOCK_STREAM) +s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +s.bind(("0.0.0.0",9077)) +""" +s2=socket.socket() +s2.connect((addr[0],9078)) + +def send2Client(pin): + s2.send(pin) +""" +s.listen(5) +go=1 +while go==1: + c, addr=s.accept() + theInput=c.recv(1024) + cmd=theInput[:3] + hash1=3 + Len=len(theInput) + for j in range(hash1+1,Len): + if theInput[j]=='#': + hash2=j + break + numInputs=int(theInput[hash1+1:hash2]) + hash1=hash2 + inputList=[] + for i in range(0,numInputs): + for j in range(hash1+1,Len): + if theInput[j]=='#': + hash2=j + break + inputList.append(theInput[hash1+1:hash2]) + hash1=hash2 + print ('try:\n\t'+commands[cmd]+'\nexcept Exception as err:\n\ta=traceback.format_exc()') + exec('try:\n\t'+commands[cmd]+'\nexcept Exception as err:\n\ta=traceback.format_exc()') + c.send(str(a)) + c.close() diff --git a/tests/unit_tests/testArduino/analog_check.sci b/tests/unit_tests/testArduino/analog_check.sci new file mode 100644 index 0000000..779f5b7 --- /dev/null +++ b/tests/unit_tests/testArduino/analog_check.sci @@ -0,0 +1,7 @@ +function analog_check() + cmd_analog_out(1,3,50) + cmd_analog_out(1,5,100) + cmd_analog_out(1,6,175) + cmd_analog_out(1,9,255) + +endfunction diff --git a/tests/unit_tests/testArduino/analog_in_check_volt.sci b/tests/unit_tests/testArduino/analog_in_check_volt.sci new file mode 100644 index 0000000..16e7905 --- /dev/null +++ b/tests/unit_tests/testArduino/analog_in_check_volt.sci @@ -0,0 +1,4 @@ +function analog_in_check_volt() + val = cmd_analog_in_volt(1,0) + cmd_analog_out_volt(1,6,val) +endfunction diff --git a/tests/unit_tests/testArduino/blink_13.sci b/tests/unit_tests/testArduino/blink_13.sci new file mode 100644 index 0000000..37dc93f --- /dev/null +++ b/tests/unit_tests/testArduino/blink_13.sci @@ -0,0 +1,6 @@ +function blink_13() + cmd_digital_out(1,13,1) //--To turn on the LED on pin no. 13 + sleep(1000) //---delay of 1 second + cmd_digital_out(1,13,0) //--To turn on the LED off pin no. 13 + sleep(1000) //---delay of 1 second +endfunction diff --git a/tests/unit_tests/testArduino/board_test_release2.sci b/tests/unit_tests/testArduino/board_test_release2.sci new file mode 100644 index 0000000..fd21cff --- /dev/null +++ b/tests/unit_tests/testArduino/board_test_release2.sci @@ -0,0 +1,11 @@ +function board_test_release2() + cmd_dcmotor_setup(1,3,1,9,10) + cmd_dcmotor_run(1,1,255) + sleep(3000) + cmd_dcmotor_release(1,1) + sleep(3000) + cmd_dcmotor_run(1,1,-255) + sleep(3000) + cmd_dcmotor_release(1,1) + sleep(3000) +endfunction diff --git a/tests/unit_tests/testArduino/digital_in_check.sci b/tests/unit_tests/testArduino/digital_in_check.sci new file mode 100644 index 0000000..4dfbeb6 --- /dev/null +++ b/tests/unit_tests/testArduino/digital_in_check.sci @@ -0,0 +1,10 @@ +function digital_in_check() + a=cmd_digital_in(1,7) + if a==1 then + cmd_digital_out(1,13,1) + cmd_digital_out(1,9,0) + else + cmd_digital_out(1,9,1) + cmd_digital_out(1,13,0) + end +endfunction diff --git a/tests/unit_tests/testArduino/i2c_master.sci b/tests/unit_tests/testArduino/i2c_master.sci new file mode 100644 index 0000000..2636185 --- /dev/null +++ b/tests/unit_tests/testArduino/i2c_master.sci @@ -0,0 +1,9 @@ +function i2c_master()
+
+ dev1 = cmd_i2c_dev(1);
+ cmd_i2c_write(dev1,10);
+ sleep(1000);
+ cmd_i2c_write(dev1,9);
+ sleep(1000);
+
+endfunction
diff --git a/tests/unit_tests/testLinearAlgebra/test_svd/testsvd.sci b/tests/unit_tests/testLinearAlgebra/test_svd/testsvd.sci new file mode 100644 index 0000000..c5da4cd --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/test_svd/testsvd.sci @@ -0,0 +1,6 @@ +function testsvd() + disp(" ** SVD Function (Singular Value Decomposition)** ") + A = [1,2,3,11;4,5,6,12;7,8,9,13] // Matrix - A + s = svd(A) // Calling Function Sequence + disp(s) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/test_svd/testsvdeconomy.sci b/tests/unit_tests/testLinearAlgebra/test_svd/testsvdeconomy.sci new file mode 100644 index 0000000..0459c79 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/test_svd/testsvdeconomy.sci @@ -0,0 +1,11 @@ +function testsvdeconomy() + disp(" ** SVD Function (Singular Value Decomposition)** ") + A = [1,2,3,11;4,5,6,12;7,8,9,13] // Matrix - A + [u,s,vt] = svd(A,'e') // Calling Function Sequence + disp("U Matrix") + disp(u) // A = U*sigma*Vt + disp("Sigma Matrix") + disp(s) + disp(" V transpose ") + disp(vt) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/test_svd/testsvdim.sci b/tests/unit_tests/testLinearAlgebra/test_svd/testsvdim.sci new file mode 100644 index 0000000..16633cc --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/test_svd/testsvdim.sci @@ -0,0 +1,6 @@ +// Function double_complex - test data. +function svdim() + b = [ (5.91+5.69*%i),(3.15-4.08*%i),(4.89+4.20*%i),(7.09+2.72*%i);(1.89+3.27*%i),(4.10+6.70*%i),(7.78+4.06*%i),(4.57+2.07*%i);(3.28+3.84*%i),(-0.79+7.21*%i),(3.88+3.30*%i),(3.84+1.19*%i)] + s = svd(b) + disp(s) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/test_svd/testsvdrank.sci b/tests/unit_tests/testLinearAlgebra/test_svd/testsvdrank.sci new file mode 100644 index 0000000..108acde --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/test_svd/testsvdrank.sci @@ -0,0 +1,13 @@ +function testsvdrank() + disp(" ** SVD Function (Singular Value Decomposition)** ") + A = [1,2,3,11;4,5,6,12;7,8,9,13] // Matrix - A + [u,s,vt,rk] = svd(A) // Calling Function Sequence + disp("U Matrix") + disp(u) // A = U*sigma*Vt + disp("Sigma Matrix") + disp(s) + disp(" V transpose ") + disp(vt) + disp("Rank") + disp(rk) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/test_svd/testsvdreal.sci b/tests/unit_tests/testLinearAlgebra/test_svd/testsvdreal.sci new file mode 100644 index 0000000..0e68e00 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/test_svd/testsvdreal.sci @@ -0,0 +1,11 @@ +function testsvdreal() + disp(" ** SVD Function (Singular Value Decomposition)** ") + A = [1,2,3,11;4,5,6,12;7,8,9,13] // Matrix - A + [u,s,vt] = svd(A) // Calling Function Sequence + disp("U Matrix") + disp(u) // A = U*sigma*Vt + disp("Sigma Matrix") + disp(s) + disp(" V transpose ") + disp(vt) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testfullrf/testfullrf.sci b/tests/unit_tests/testLinearAlgebra/testfullrf/testfullrf.sci new file mode 100644 index 0000000..49d3c7a --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testfullrf/testfullrf.sci @@ -0,0 +1,7 @@ +function testfullrf() + A = [1,2,3;4,5,6;7,8,9] + [Q,M,rk] = fullrf(A) + disp(Q) + disp(M) + disp(rk) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testgivens/testgivens.sci b/tests/unit_tests/testLinearAlgebra/testgivens/testgivens.sci new file mode 100644 index 0000000..3ef0d28 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testgivens/testgivens.sci @@ -0,0 +1,7 @@ +function testgivens() + a = [1] + b = [2] + [u,c] = givens(a,b) + disp(u) + disp(c) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testhess/testhess.sci b/tests/unit_tests/testLinearAlgebra/testhess/testhess.sci new file mode 100644 index 0000000..f991ae9 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testhess/testhess.sci @@ -0,0 +1,5 @@ +function testhess() + a = [0,0,0,0;0,6,7,8;9,10,11,12;13,14,15,16]; + h = hess(a) + disp(h) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testhouseholder/testhouseholder.sci b/tests/unit_tests/testLinearAlgebra/testhouseholder/testhouseholder.sci new file mode 100644 index 0000000..30b4c20 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testhouseholder/testhouseholder.sci @@ -0,0 +1,6 @@ +function testhouseholder() + A = [1;2;3;4;5] + B = [6;7;8;9;10] + u = householder(A,B) + disp(u) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testnorm/testnorm.sci b/tests/unit_tests/testLinearAlgebra/testnorm/testnorm.sci new file mode 100644 index 0000000..727a895 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testnorm/testnorm.sci @@ -0,0 +1,6 @@ +//* Function to find, norm(a,2) +function testnorm() + a = [1,2,3;4,5,6;7,8,9] // Matrix + d = norm(a,2); // Calling NORM function. + disp(d) // display output +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testqr/testQR.sci b/tests/unit_tests/testLinearAlgebra/testqr/testQR.sci new file mode 100644 index 0000000..292e1cb --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testqr/testQR.sci @@ -0,0 +1,8 @@ +function testQR() + A = [1,2,3;4,5,6] + [u,a,rk,e] = qr(A); + disp(u) + disp(a) + disp(rk) + disp(e) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testrowcomp/testrcomp.sci b/tests/unit_tests/testLinearAlgebra/testrowcomp/testrcomp.sci new file mode 100644 index 0000000..f8da948 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testrowcomp/testrcomp.sci @@ -0,0 +1,6 @@ +function testrcomp() + A = [1,2,3;4,5,6] + [u,rk] = rowcomp(A,"qr") + disp(u) + disp(rk) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testspec/testspec.sci b/tests/unit_tests/testLinearAlgebra/testspec/testspec.sci new file mode 100644 index 0000000..6e9346d --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testspec/testspec.sci @@ -0,0 +1,9 @@ +function testspec() + A = [1,2,3;4,5,6;7,8,9] + B = [10,11,12;13,14,15;16,17,18] + [R,diagevals,c,d] = spec(A,B) + disp(R) + disp(diagevals) + disp(c) + disp(d) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testsqroot/testsqroot.sci b/tests/unit_tests/testLinearAlgebra/testsqroot/testsqroot.sci new file mode 100644 index 0000000..63db1f4 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testsqroot/testsqroot.sci @@ -0,0 +1,5 @@ +function testsqroot() + a = [1,2,3;4,5,6;7,8,9]; + e = sqroot(a); + disp(e) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testsva/testsva.sci b/tests/unit_tests/testLinearAlgebra/testsva/testsva.sci new file mode 100644 index 0000000..c710723 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testsva/testsva.sci @@ -0,0 +1,7 @@ +function testsva() + a = [1,2,3,4;5,6,7,8;9,10,11,12] + [u,s,v] = sva(a) + disp(u) + disp(s) + disp(v) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testsva/testsvatol.sci b/tests/unit_tests/testLinearAlgebra/testsva/testsvatol.sci new file mode 100644 index 0000000..b199ec3 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testsva/testsvatol.sci @@ -0,0 +1,9 @@ +// function Singular Value Approx. + +function testsvatol() + a = [1,2,3,4;5,6,7,8;9,10,11,12] + [u,s,v] = sva(a,1) + disp(u) + disp(s) + disp(v) +endfunction diff --git a/tests/unit_tests/test_RPi/lcd.sci b/tests/unit_tests/test_RPi/lcd.sci new file mode 100644 index 0000000..984ecbb --- /dev/null +++ b/tests/unit_tests/test_RPi/lcd.sci @@ -0,0 +1,47 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function lcd() + raspi("10.42.0.144","panda","pi"); // setup connection to Pi + RPI_pinNumbering("wiringpi"); // initialize pin numbering + // LCD connections: + // 2 rows + // 16 columns + // 8 bits + // wiringPi pin 28 - rs + // wiringPi pin 29 - strobe/E + // wiringPi pins 0-7 - lcd data pins 0 to 7 + // + + fd=RPI_lcdInit(2,16,8,28,29,0,1,2,3,4,5,6,7) // initialize lcd with the above mentioned connections + RPI_lcdDisplay(fd,1) // switch on display + RPI_lcdCursor(fd,1) // show the cursor + RPI_lcdCursorBlink(fd,1) // blink the cursor + RPI_lcdPrintf(fd,"The Elder") // print to lcd + RPI_lcdPosition(fd,0,1) // Goto second row first column + RPI_lcdPrintf(fd,"Scrolls V Skyrim") // print to lcd + RPI_lcdHome(fd) // goto first row first column (0,0) + RPI_lcdClear(fd) // clear the lcd + RPI_lcdPrintf(fd,"Volume: ") // print character corresponding to number 125 + RPI_lcdCharDef(fd,0,0,0,0,0,0,0,0,255) // define a custom character at position 0 + RPI_lcdCharDef(fd,1,0,0,0,0,0,0,255,255) // define a custom character at position 1 + RPI_lcdCharDef(fd,2,0,0,0,0,0,255,255,255) + RPI_lcdCharDef(fd,3,0,0,0,0,255,255,255,255) + RPI_lcdCharDef(fd,4,0,0,0,255,255,255,255,255) + RPI_lcdCharDef(fd,5,0,0,255,255,255,255,255,255) + RPI_lcdCharDef(fd,6,0,255,255,255,255,255,255,255) + RPI_lcdCharDef(fd,7,255,255,255,255,255,255,255,255) + for i=0:7:1 + RPI_lcdPutchar(fd,1) // print the custom characters + end + disp("Demo completed successfully.") + raspi_close(); // close the opened connection +endfunction diff --git a/tests/unit_tests/test_RPi/wait_and_blink.sci b/tests/unit_tests/test_RPi/wait_and_blink.sci new file mode 100644 index 0000000..7f77ad0 --- /dev/null +++ b/tests/unit_tests/test_RPi/wait_and_blink.sci @@ -0,0 +1,27 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function wait_and_blink() + raspi("10.42.0.144","panda","pi"); // setup connection to Pi + RPI_pinNumbering("wiringpi"); // initialize pin numbering + RPI_pinMode(0,"out"); // set pin 0 as OUTPUT + RPI_pinMode(1,"in"); // set pin 1 as INPUT + RPI_waitForInterrupt(1,-1); // wait for Interrupt at pin 1,with no timeout. + for i=1:5 // interrupt recieved + RPI_digitalWrite(0,1); // set pin 0 voltage HIGH + RPI_delay(1000); // delay for 1 second + RPI_digitalWrite(0,0); // set pin 0 voltage LOW + RPI_delay(1000); // delay for 1 second + end + RPI_pinMode(0,"in"); // reset pin 0 to INPUT + disp("Demo completed successfully.") + raspi_close(); // close the opened connection +endfunction diff --git a/tests/unit_tests/test_analogFilters/scilabcode/main.sci b/tests/unit_tests/test_analogFilters/scilabcode/main.sci new file mode 100644 index 0000000..85fc494 --- /dev/null +++ b/tests/unit_tests/test_analogFilters/scilabcode/main.sci @@ -0,0 +1,33 @@ +// This is the demo function to test the analog filters +// They are of 4 types butterworth,chebyshev-1,chebyshev-2 and elliptic +// We are going to test here the butterworth, chebyshev-1 and chebyshev-2 filters +//zpbutt->butterworth filter +//zpch1 ->chebyshev type-1 filter +//zpch2 ->chebyshev type-2 filter +function main() + n=5; //n is the filter order + fl=3; //fl is the cutoff frequency + [pb,gb]=zpbutt(n,fl); + disp("poles of butterworth filter") + disp(pb); + disp("gain of butterworth filter"); + disp(gb); + + e=0.5; //e (epsilon) it is the ripples in pass band + wc=4; // wc cutoff frequency + [pc1,gc1]=zpch1(n,e,wc); + disp("poles of chebyshev-1 filter") + disp(pc1); + disp("gain of chebyshev-1 filter") + disp(gc1); + + a=4; //a is the attenuation in stop band + w=5; //w (omega) is the cutoff frequency + [zc2,pc2,gc2]=zpch2(n,a,w); + disp("zeros of chebyshev-2 filter") + disp(zc2); + disp("poles of chebyshev-2 filter") + disp(pc2); + disp("gain of chebyshev-2 filter") + disp(gc2); +endfunction diff --git a/tests/unit_tests/test_analogFilters/scilabcode/zpbutttest.sci b/tests/unit_tests/test_analogFilters/scilabcode/zpbutttest.sci new file mode 100644 index 0000000..1ea723d --- /dev/null +++ b/tests/unit_tests/test_analogFilters/scilabcode/zpbutttest.sci @@ -0,0 +1,7 @@ +function zpbutttest() + n=5; + fl=3; + [p,g]=zpbutt(n,fl); + disp(p); + disp(g); +endfunction diff --git a/tests/unit_tests/test_analogFilters/scilabcode/zpch1test.sci b/tests/unit_tests/test_analogFilters/scilabcode/zpch1test.sci new file mode 100644 index 0000000..4f29e0d4 --- /dev/null +++ b/tests/unit_tests/test_analogFilters/scilabcode/zpch1test.sci @@ -0,0 +1,9 @@ +function zpch1test() + + N=5; //N is the filter order + e=0.5; //e (epsilon) it is the ripples in pass band + wc=4; // wc cutoff frequency + [p,g]=zpch1(N,e,wc); + disp(p); + disp(g); +endfunction diff --git a/tests/unit_tests/test_analogFilters/scilabcode/zpch2test.sci b/tests/unit_tests/test_analogFilters/scilabcode/zpch2test.sci new file mode 100644 index 0000000..665fb41 --- /dev/null +++ b/tests/unit_tests/test_analogFilters/scilabcode/zpch2test.sci @@ -0,0 +1,9 @@ +function zpch2test() + n=5; + a=4; + w=5; + [z,p,g]=zpch2(n,a,w); + disp(z); + disp(p); + disp(g); +endfunction diff --git a/tests/unit_tests/test_ffilt/scilabcode/ffilttest.sci b/tests/unit_tests/test_ffilt/scilabcode/ffilttest.sci new file mode 100644 index 0000000..fcf1732 --- /dev/null +++ b/tests/unit_tests/test_ffilt/scilabcode/ffilttest.sci @@ -0,0 +1,8 @@ +function ffilttest() + ft="sb"; + ni=5; + fc=0.2; + fh=0.9; + xi=ffilt(ft,ni,fc,fh); + disp(xi); +endfunction diff --git a/tests/unit_tests/test_ffilt/scilabcode/main.sci b/tests/unit_tests/test_ffilt/scilabcode/main.sci new file mode 100644 index 0000000..ced653a --- /dev/null +++ b/tests/unit_tests/test_ffilt/scilabcode/main.sci @@ -0,0 +1,12 @@ +// The main function test the ffilt function +// ffilt->returns the coefficients of FIR low pass filter +function main() + ft="sb"; //ft is the type of filter + ni=5; //ni is the number of filters sample required + fc=0.2; //low frequency cutoff + fh=0.9; //high cutoff frequency + xi=ffilt(ft,ni,fc,fh); + disp(xi); +endfunction +//output +// 0.2449143 0.4898285 - 0.4 0.4898285 0.2449143 diff --git a/tests/unit_tests/test_filterResponse/scilabcode/buttmagtest.sci b/tests/unit_tests/test_filterResponse/scilabcode/buttmagtest.sci new file mode 100644 index 0000000..c7426c2 --- /dev/null +++ b/tests/unit_tests/test_filterResponse/scilabcode/buttmagtest.sci @@ -0,0 +1,7 @@ +function buttmagtest() + smp=[1:5]; + od=6; + frq=2.2; + oup=buttmag(od,frq,smp); + disp(oup); +endfunction diff --git a/tests/unit_tests/test_filterResponse/scilabcode/cheb1magtest.sci b/tests/unit_tests/test_filterResponse/scilabcode/cheb1magtest.sci new file mode 100644 index 0000000..7d09637 --- /dev/null +++ b/tests/unit_tests/test_filterResponse/scilabcode/cheb1magtest.sci @@ -0,0 +1,8 @@ +function cheb1magtest() + od=5; + wfc=3; + eps=0.3; + sap=[1:5]; + out=cheb1mag(od,wfc,eps,sap); + disp(out); +endfunction diff --git a/tests/unit_tests/test_filterResponse/scilabcode/ell1magtest.sci b/tests/unit_tests/test_filterResponse/scilabcode/ell1magtest.sci new file mode 100644 index 0000000..b53c435 --- /dev/null +++ b/tests/unit_tests/test_filterResponse/scilabcode/ell1magtest.sci @@ -0,0 +1,7 @@ +function ell1magtest() + eps1=0.2; + m11=0.4; + z1=[1,2,3]; + [s1]=ell1mag(eps1,m11,z1); + disp(s1); +endfunction diff --git a/tests/unit_tests/test_filterResponse/scilabcode/main.sci b/tests/unit_tests/test_filterResponse/scilabcode/main.sci new file mode 100644 index 0000000..6a8cbc5 --- /dev/null +++ b/tests/unit_tests/test_filterResponse/scilabcode/main.sci @@ -0,0 +1,20 @@ +function main() + + order=5; + sample1=[1:5]; + frq=2.2; + out1=buttmag(order,frq,sample1); + disp(out1); + + wfc=3; + eps=0.3; + sample2=[1:5]; + out2=cheb1mag(order,wfc,eps,sample2); + disp(out2); + + eps1=0.2; + m11=0.4; + z1=[1,2,3]; + [s1]=ell1mag(eps1,m11,z1); + disp(s1); +endfunction diff --git a/tests/unit_tests/test_filtsinc/scilabcode/filt_sinctest.sci b/tests/unit_tests/test_filtsinc/scilabcode/filt_sinctest.sci new file mode 100644 index 0000000..ab674b6 --- /dev/null +++ b/tests/unit_tests/test_filtsinc/scilabcode/filt_sinctest.sci @@ -0,0 +1,10 @@ +//This is the demo for filt_sinc function +//This function gives the samples of the sinc fuction +function filt_sinctest() + ni=int(10); //This is the number of samples + fc=2; //This is the cut-off freq. of the assosciated low pass filter + sd=filt_sinc(ni,fc); + disp(sd); +endfunction +//output +// diff --git a/tests/unit_tests/test_fsfirlin/scilabcode/fsfirlintest.sci b/tests/unit_tests/test_fsfirlin/scilabcode/fsfirlintest.sci new file mode 100644 index 0000000..4ecec4e --- /dev/null +++ b/tests/unit_tests/test_fsfirlin/scilabcode/fsfirlintest.sci @@ -0,0 +1,6 @@ +function fsfirlintest() + in=[1 2 3 4 5 6 7 8]; + flg=2; + op=fsfirlin(in,flg); + disp(op); +endfunction diff --git a/tests/unit_tests/test_fsfirlin/scilabcode/main.sci b/tests/unit_tests/test_fsfirlin/scilabcode/main.sci new file mode 100644 index 0000000..a3acc51 --- /dev/null +++ b/tests/unit_tests/test_fsfirlin/scilabcode/main.sci @@ -0,0 +1,9 @@ +//This is the demo file to test the function fsfirlin +//The function gives design of FIR,linear phase filters using frequency sampling technique +function main() + in=[1 2 3 4 5 6 7 8]; //This is the vector of desired frequency responses samples + flg=2; //flg=2 for type-2 filter , it can be 1 for type-1 filter + op=fsfirlin(in,flg); + disp(op); +endfunction +//output diff --git a/tests/unit_tests/test_jacobi/scilabcode/main.sci b/tests/unit_tests/test_jacobi/scilabcode/main.sci new file mode 100644 index 0000000..ee229eb --- /dev/null +++ b/tests/unit_tests/test_jacobi/scilabcode/main.sci @@ -0,0 +1,18 @@ +// Demo function to test %sn and %k functions +// %sn is the Jacobi's elliptic function +// %k is the Jacobi's complete integral +function main() + u=[1+2*%i 2+3*%i 3+1*%i]; // the corresponding complex vector + k=0.6; // parameter of elliptic integral + [out]=%sn(u,k); + disp(out); + m=[0.1 0.2 0.3]; // parametrt of Jacobi complete integral + s=%k(m); + disp(s); +endfunction + +//Output +//for %sn +// 1.5641568 - 0.2037920i 1.0580372 + 0.0100213i 1.1386855 - 0.4631921i +// for %k +// 1.6124413 1.6596236 1.7138894 diff --git a/tests/unit_tests/test_jacobi/scilabcode/modktest.sci b/tests/unit_tests/test_jacobi/scilabcode/modktest.sci new file mode 100644 index 0000000..613cd33 --- /dev/null +++ b/tests/unit_tests/test_jacobi/scilabcode/modktest.sci @@ -0,0 +1,5 @@ +function modktest() + m=[0.1 0.2 0.3]; + s=%k(m); + disp(s); +endfunction diff --git a/tests/unit_tests/test_jacobi/scilabcode/modsntest.sci b/tests/unit_tests/test_jacobi/scilabcode/modsntest.sci new file mode 100644 index 0000000..dc5d435 --- /dev/null +++ b/tests/unit_tests/test_jacobi/scilabcode/modsntest.sci @@ -0,0 +1,6 @@ +function modsntest() + u=[1+2*%i 2+3*%i 3+1*%i]; // the corresponding complex vector + k=0.6; // parameter of elliptic integral + [out]=%sn(u,k); + disp(out); +endfunction diff --git a/tests/unit_tests/test_string/scilabcode/asciitest.sci b/tests/unit_tests/test_string/scilabcode/asciitest.sci new file mode 100644 index 0000000..aa0017d --- /dev/null +++ b/tests/unit_tests/test_string/scilabcode/asciitest.sci @@ -0,0 +1,11 @@ +//This function test the ascii function in scilab. +//Ascii function takes the input string and then gives the ascii code of the string. +// The output for the scilab will be:- +//[97. 110. 107. 105. 116. 32. 105. 115. 32. 114. 97. 106.] + +function asciitest() + y="ankit is raj"; //This is the input string for testing the function. + x=ascii(y); //calling of the function + disp(x); +endfunction + diff --git a/tests/unit_tests/test_string/scilabcode/asciitest2.sci b/tests/unit_tests/test_string/scilabcode/asciitest2.sci new file mode 100644 index 0000000..ca7dcb7 --- /dev/null +++ b/tests/unit_tests/test_string/scilabcode/asciitest2.sci @@ -0,0 +1,5 @@ +function asciitest2() + d=[97 98 99 100 101]; + si=ascii(d); + disp(si); +endfunction diff --git a/tests/unit_tests/test_string/scilabcode/main.sci b/tests/unit_tests/test_string/scilabcode/main.sci new file mode 100644 index 0000000..4030ee0 --- /dev/null +++ b/tests/unit_tests/test_string/scilabcode/main.sci @@ -0,0 +1,30 @@ +//This is the demo function to test a set of string functions +// ascii->converts the input char vector/array to corresponding ascii code or vice versa +// strchr-> it finds the occurence of a charcter in a given string +// strncpy->copy charcters from string +// strspn-> get span of character set in string + +function main() + strascii1="ankit is raj"; //This is the input string for testing the function. + asciiout1=ascii(strascii1); //calling of the function + disp(asciiout1); + + strascii2=[97 98 99 100 101]; //Input as the ascii code to get converted to string + asciiout2=ascii(strascii2); //calling the function + disp(asciiout2); + + str="This is a sample string"; + ch="s"; + out1=strchr(str,ch); + disp(out1); + + ss="Ankit Raj"; + nn=5; + resu=strncpy(ss,nn); + disp(resu); + + strsample2="Hello this is Ankit"; + a="Ank"; + oup2=strspn(a,strsample2); + disp(oup2) +endfunction diff --git a/tests/unit_tests/test_string/scilabcode/strchrtest.sci b/tests/unit_tests/test_string/scilabcode/strchrtest.sci new file mode 100644 index 0000000..f8d3419 --- /dev/null +++ b/tests/unit_tests/test_string/scilabcode/strchrtest.sci @@ -0,0 +1,6 @@ +function strchrtest() + s="This is a sample string"; + ch="s"; + y=strchr(s,ch); + disp(y); +endfunction diff --git a/tests/unit_tests/test_string/scilabcode/strcspntest.sci b/tests/unit_tests/test_string/scilabcode/strcspntest.sci new file mode 100644 index 0000000..9a03c57 --- /dev/null +++ b/tests/unit_tests/test_string/scilabcode/strcspntest.sci @@ -0,0 +1,6 @@ +function strcspntest() + x="123243545assdsc"; + y="anki5t3"; + z=strcspn(y,x); + disp(z); +endfunction diff --git a/tests/unit_tests/test_string/scilabcode/strncpytest.sci b/tests/unit_tests/test_string/scilabcode/strncpytest.sci new file mode 100644 index 0000000..14eceb8 --- /dev/null +++ b/tests/unit_tests/test_string/scilabcode/strncpytest.sci @@ -0,0 +1,6 @@ +function strncpytest() + ss="Ankit Raj"; + nn=5; + resu=strncpy(ss,nn); + disp(resu); +endfunction diff --git a/thirdparty/lib/raspberrypi/libgsl.a b/thirdparty/lib/raspberrypi/libgsl.a Binary files differindex 1eb5d60..c37a696 100644 --- a/thirdparty/lib/raspberrypi/libgsl.a +++ b/thirdparty/lib/raspberrypi/libgsl.a diff --git a/thirdparty/lib/raspberrypi/liblapack.a b/thirdparty/lib/raspberrypi/liblapack.a Binary files differindex 9af700f..7ec0eb9 100644 --- a/thirdparty/lib/raspberrypi/liblapack.a +++ b/thirdparty/lib/raspberrypi/liblapack.a |