• V1.2 6be38cd51b

    hliu092 released this 2026-11-24 07:05:07 +00:00 | 0 commits to main since this release

    The DOI of this source code: https://doi.org/10.58473/ChengZhuSci0003/02

    Introduction:  My newly designed 3 - dimension (I × E × N) matrix better meets the needs of systematic metabolomics study. This article adopts both 2-dimensional arrays and 3-dimensional arrays to calculate the isozyme zymograms designed in my article, which facilitates the matrix calculation process.

    Development language: C++;

    All Rights Reserved.

    Reference: Liu Huan (2024). Original Review of Environmental Physiology: Photosynthesis and Systematic Metabolomics. Journal of Biological Sciences (ISSN 2958-4035).2024(07). https://doi.org/10.58473/JBS0024

    Copyrights Certificate Registered by Brock Chain Technology: Brock Chain ID. (a397acb64a636cfcefc9ee780a8d5bc8be27ca39a25750e5ae529143e6cbfbb1). Registered Time: 2025-11-13 08:37.

    Source Code:
    //@ All rights reserved by Liu Huan. Source from: https://doi.org/10.58473/JBS0024

    #include <bits/stdc++.h>
    using namespace std;
    int a[101][101][101], a1[101][101], a2[101][101], a3[101][101], b1[101][101], b2[101][101], b3[101][101], c1[101][101], c2[101][101], c3[101][101], d1[101][101], d2[101][101], d3[101][101], E1[101][101], E2[101][101], E3[101][101], F1[101][101], G1[101][101], H1[101][101], I1[101][101], I2[101][101], I3[101][101];
    int main ()
    {
    int n,e,i,t;

    cout << "\n=== Input the values (0 or 1) for matrix X[n][e][i] (leaving a space between values) ===" << endl;	
    for(n=1;n<=3;n++)
       for(e=1;e<=4;e++)
          for(i=1;i<=5;i++)
       cin>>a[n][e][i];  //input the value of matrix Xnei£¬ a[n][e][i] is zero or one ; 3*4*5 Matrix
       
       cout<<endl;
    
    for(n=1;n<=3;n++)
    	 for(i=1;i<=5;i++)
    		 b1[n][i]=a[n][1][i];  //select the value of matrix Xni, when e is 1 ; 3*5 Matrix
    
    for(n=1;n<=5;n++)
        for(i=1;i<=3;i++)
             b2[n][i]=b1[i][n];  // the tronspose of matrix Xni ; 5*3 Matrix
             
    for(n=1;n<=5;n++)
    	for(i=1;i<=5;i++) 
    	   for(t=1;t<=3;t++)        
             b3[n][i]+=b2[n][t]*b1[t][i];  // the value of the transpose of matrix Xni (5*3) multiplied by matrix Xni (3*5); final value are 5*5 Matrix
             
    for(n=1;n<=3;n++)
    	 for(i=1;i<=5;i++)
    		 c1[n][i]=a[n][2][i];  //select the value of matrix Xni, when e is 2 ; 3*5 Matrix
    
    for(n=1;n<=5;n++)
        for(i=1;i<=3;i++)
             c2[n][i]=c1[i][n];  //the tronspose of matrix Xni ;  5*3 Matrix
             
    for(n=1;n<=5;n++)
    	for(i=1;i<=5;i++) 
    	   for(t=1;t<=3;t++)        
             c3[n][i]+=c2[n][t]*c1[t][i]; // the value of the transpose of matrix Xni (5*3) multiplied by matrix Xni (3*5); final value are 5*5 Matrix
    		 
    for(n=1;n<=3;n++)
    	 for(i=1;i<=5;i++)
    		 d1[n][i]=a[n][3][i]; //select the value of matrix Xni, when e is 3 ; 3*5 Matrix
    
    for(n=1;n<=5;n++)
        for(i=1;i<=3;i++)
             d2[n][i]=d1[i][n]; //the tronspose of matrix Xni ; 5*3 Matrix
             
    for(n=1;n<=5;n++)
    	for(i=1;i<=5;i++) 
    	   for(t=1;t<=3;t++)        
             d3[n][i]+=d2[n][t]*d1[t][i];	// the value of the transpose of matrix Xni (5*3) multiplied by matrix Xni (3*5); final value are 5*5 Matrix
    		 
    for(n=1;n<=3;n++)
    	 for(i=1;i<=5;i++)
    		 E1[n][i]=a[n][4][i];  //select the value of matrix Xni, when e is 4 ; 3*5 Matrix
    
    for(n=1;n<=5;n++)
        for(i=1;i<=3;i++)
             E2[n][i]=E1[i][n];  //the tronspose of matrix Xni ; 5*3 Matrix
             
    for(n=1;n<=5;n++)
    	for(i=1;i<=5;i++) 
    	   for(t=1;t<=3;t++)        
             E3[n][i]+=E2[n][t]*E1[t][i];	// the value of the transpose of matrix Xni (5*3) multiplied by matrix Xni (3*5); final value are 5*5 Matrix   
    
    cout << "\n=== The matrix (5*5) for variable i ===" << endl;		 
    for(n=1;n<=5;n++)
    {
    	 for(i=1;i<=5;i++)
    	 cout<<b3[n][i]+c3[n][i]+d3[n][i]+E3[n][i]<<" ";  //output the value of the sum of matrix for PCA ; 5*5 Matrix;
    	 cout<<endl;
    }
      
         cout<<endl;
         
    for(n=1;n<=3;n++)
    	for(i=1;i<=5;i++)
    	 a1[n][i]=b1[n][i]+c1[n][i]+d1[n][i]+E1[n][i]; //to calculate the value of Matrix sum Xni ; 3*5 Matrix
    	 
    for(n=1;n<=5;n++)
        for(i=1;i<=3;i++)
             a2[n][i]=a1[i][n]; 	 // the transpose of Matrix sum Xni ; 5*3 Matrix
             
    for(n=1;n<=3;n++)
    	for(i=1;i<=3;i++) 
    	   for(t=1;t<=5;t++)        
             a3[n][i]+=a1[n][t]*a2[t][i];         //the value of Matrix sum Xni (3*5) multiplied by its transpose (5*3); final values are 3*3 Matrix
    
    cout << "\n=== The matrix (3*3) for variable n ===" << endl;	
    for(n=1;n<=3;n++)
    {
    	 for(i=1;i<=3;i++)
    	 cout<<a3[n][i]<<" ";  //output the value for PCA ; 3*3 Matrix; 
    	 cout<<endl;
    }       
    
        cout<<endl;
        
        
    	  return 0;
       }
    

    //@ All rights reserved by Liu Huan. Source from: https://doi.org/10.58473/JBS0024

    #include <bits/stdc++.h>
    using namespace std;
    int a1[101][101], a2[101][101], a3[101][101], b1[101][101], b2[101][101], b3[101][101];
    int main ()
    {
    int e,i,t;

    cout << "\n=== Input the values (0 or 1) for matrix X[1][e][i] (leaving a space between values) ===" << endl;		
       for(e=1;e<=4;e++)
          for(i=1;i<=5;i++)
           cin>>a1[e][i];  //input the value of matrix Xei£¬ a1[e][i] is zero or one ; 4*5 Matrix
           
    cout << "\n=== Input the values (0 or 1) for matrix X[2][e][i] (leaving a space between values) ===" << endl;	   
       for(e=1;e<=4;e++)
          for(i=1;i<=5;i++)
          cin>>a2[e][i]; //input the value of matrix Xei£¬ a2[e][i] is zero or one ; 4*5 Matrix
          
    cout << "\n=== Input the values (0 or 1) for matrix X[3][e][i] (leaving a space between values) ===" << endl;	   
        for(e=1;e<=4;e++)
          for(i=1;i<=5;i++)
          cin>>a3[e][i]; //input the value of matrix Xei£¬ a3[e][i] is zero or one ; 4*5 Matrix
          
        cout<<endl;		
    	
    for(e=1;e<=4;e++)
        for(i=1;i<=5;i++)	 
    	b1[e][i]=a1[e][i]+a2[e][i]+a3[e][i]; // the sum of Matrix Xei; 4*5 Matrix	    
    
    for(e=1;e<=5;e++)
        for(i=1;i<=4;i++) 
        b2[e][i]=b1[i][e];  // the transpose of Matrix sum Xei; 5*4 Matrix
        
    for(e=1;e<=4;e++)
        for(i=1;i<=4;i++)	
    	   for(t=1;t<=5;t++)
        b3[e][i]+=b1[e][t]*b2[t][i]; //the value of the Matrix sum Xei (4*5 Matrix), multiplied by its transpose (5*4 Matrix); final values are 4*4 Matrix	
    
    cout << "\n=== The matrix (4*4) for variable e ===" << endl;
    for(e=1;e<=4;e++)
    {
    	 for(i=1;i<=4;i++)
    	 cout<<b3[e][i]<<" ";  //output the value for PCA ; 4*4 Matrix
    	 cout<<endl;
    }       
    
        return 0;
        
    }
    
    Downloads