• V1.1 6be38cd51b

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

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

    Introduction: This model adopts Chinese Eight Diagrams’ matrix to simulate the interaction relationship between Yin and Yang poles in the universe, which is input by using binary algorithm (To simplify the process, the decimalism is used in the calculation process instead);

    Development language: C++;

    All Rights Reserved.

    Reference: Liu Huan. (2021). Ancient Chinese Eight Diagrams and Application on Chemistry Reaction Rate. Journal of Quantum Physics and Materials Chemistry (ISSN2958-4027) , Latest revised on 26/12/2024.  https://doi.org/10.58473/JQPMC0010.

    Copyrights Certificate Registered by Brock Chain Technology: Brock Chain ID. (b3ad241f75c04ffd50bb51603ee38729d3b30867c7f6c40be0c2f70db407998c) ; Register Time: 2025-11-13 10:40;

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

    #include <bits/stdc++.h>
    using namespace std;
    int a[101][101],b[101][101],c[101][101],d[101][101],e[101][101],f[101][101],g[101][101],H[101][101],I[101][101],J[101][101],K[101][101],L[101][101],M[101][101],N[101][101],O[101][101],P[101][101],Q[101][101],R[101][101];
    int main ()
    {
    cout << "\n=== Input the values' amount (n) for each array ===" << endl;
    int i,j,n,t;
    cin>>n;
    cout << "\n=== Input the values (0 or 1) for n*8 Yin matrix [i][j] (leaving a space between values) ===" << endl;
    for(i=1;i<=n;i++)
    for(j=1;j<=8;j++)
    cin>>a[i][j]; //input the value in Yin array£¬a[i][j] can be 0 or 1

    cout << "\n=== Input the values (0 or 1) for n*8 Yang matrix [i][j] (leaving a space between values) ===" << endl;	   
    for(i=1;i<=n;i++)
        for(j=1;j<=8;j++)
        cin>>b[i][j];  // input the value in Yang array£¬b[i][j] can be 0 or 1
        
        cout<<endl;
        
    cout << "\n=== In total 8 Matrices (n*n) to show the interaction between Yin and Yang matrix in a cycle===" << endl;
    
    for(i=1;i<=8;i++)
       for(j=1;j<=n;j++) 
       c[i][j]=b[j][i];  // To calculate the inverted Yang matrix
       
    for(i=1;i<=n;i++)
       for(j=1;j<=n;j++) 
           for(t=1;t<=8;t++)
           {
    	   d[i][j]+=a[i][t]*c[t][j];  // To calculate the Yin Matrix multiplied by the inverted Yang Matrix
        }
            
    for(i=1;i<=n;i++)
       {
       	for(j=1;j<=n;j++) 
         cout<<d[i][j]<<" ";    // Output the matrix of the Yin Matrix multiplied by the inverted Yang Matrix£¨n*n£© 
         cout<<endl;
       }
       cout<<endl;   
       
    for(i=1;i<=n;i++)
    {
       for(j=1;j<=8;j++)
       {
       	 if(j==1) e[i][j]=a[i][8];
       	 else e[i][j]=a[i][j-1];   // The transformed Yin Matrix after it circles to the next grid at the clockwise direction 
       }
    

    }

    for(i=1;i<=n;i++)
       for(j=1;j<=n;j++) 
           for(t=1;t<=8;t++)
           f[i][j]+=e[i][t]*c[t][j];  // To calculate the result of the transformed Yin Matrix multiplied by the inverted Yang Matrix
    
    for(i=1;i<=n;i++)
    {
    	for(j=1;j<=n;j++)
       	cout<<f[i][j]<<" ";           // Output the matrix of Yin Matrix multiplied by the inverted Yang Matrix£¨n*n£©  
       	cout<<endl;  
    }
       cout<<endl;   
    
    for(i=1;i<=n;i++)
    {
       for(j=1;j<=8;j++)
       {
       	 if(j==1) g[i][j]=e[i][8];
       	 else g[i][j]=e[i][j-1];      // The transformed Yin Matrix after it circles to the next grid at the clockwise direction again
       }
    

    }

    for(i=1;i<=n;i++)
       for(j=1;j<=n;j++) 
           for(t=1;t<=8;t++)
           H[i][j]+=g[i][t]*c[t][j];  // To calculate the result of the transformed Yin Matrix multiplied by the inverted Yang Matrix
    
    for(i=1;i<=n;i++)
    {
    	for(j=1;j<=n;j++)
       	cout<<H[i][j]<<" ";          //  Output the matrix of Yin Matrix multiplied by the inverted Yang Matrix£¨n*n£©
       	cout<<endl;  
    }
       cout<<endl;   
     
    for(i=1;i<=n;i++)
    {
       for(j=1;j<=8;j++)
       {
       	 if(j==1) I[i][j]=g[i][8];
       	 else I[i][j]=g[i][j-1];      // The transformed Yin Matrix after it circles to the next grid at the clockwise direction again
       }
    

    }

    for(i=1;i<=n;i++)
       for(j=1;j<=n;j++) 
           for(t=1;t<=8;t++)
           J[i][j]+=I[i][t]*c[t][j];  // To calculate the result of the transformed Yin Matrix multiplied by the inverted Yang Matrix
    
    for(i=1;i<=n;i++)
    {
    	for(j=1;j<=n;j++)
       	cout<<J[i][j]<<" ";           // Output the matrix of Yin Matrix multiplied by the inverted Yang Matrix£¨n*n£©
       	cout<<endl;  
    }
       cout<<endl;   
     
    for(i=1;i<=n;i++)
    {
       for(j=1;j<=8;j++)
       {
       	 if(j==1) K[i][j]=I[i][8];
       	 else K[i][j]=I[i][j-1];      // The transformed Yin Matrix after it circles to the next grid at the clockwise direction again
       }
    

    }

    for(i=1;i<=n;i++)
       for(j=1;j<=n;j++) 
           for(t=1;t<=8;t++)
           L[i][j]+=K[i][t]*c[t][j];  // To calculate the result of the transformed Yin Matrix multiplied by the inverted Yang Matrix
    
    for(i=1;i<=n;i++)
    {
    	for(j=1;j<=n;j++)
       	cout<<L[i][j]<<" ";          // Output the matrix of Yin Matrix multiplied by the inverted Yang Matrix£¨n*n£©
       	cout<<endl;  
    }
       cout<<endl;   
    
    for(i=1;i<=n;i++)
    {
       for(j=1;j<=8;j++)
       {
       	 if(j==1) M[i][j]=K[i][8];
       	 else M[i][j]=K[i][j-1];      // The transformed Yin Matrix after it circles to the next grid at the clockwise direction again
       }
    

    }

    for(i=1;i<=n;i++)
       for(j=1;j<=n;j++) 
           for(t=1;t<=8;t++)
           N[i][j]+=M[i][t]*c[t][j];  // To calculate the result of the transformed Yin Matrix multiplied by the inverted Yang Matrix
    
    for(i=1;i<=n;i++)
    {
    	for(j=1;j<=n;j++)
       	cout<<N[i][j]<<" ";          //  Output the matrix of Yin Matrix multiplied by the inverted Yang Matrix£¨n*n£©
       	cout<<endl;  
    }
       cout<<endl;   
    
    for(i=1;i<=n;i++)
    {
       for(j=1;j<=8;j++)
       {
       	 if(j==1) O[i][j]=M[i][8];
       	 else O[i][j]=M[i][j-1];      //  The transformed Yin Matrix after it circles to the next grid at the clockwise direction again
       }
    

    }

    for(i=1;i<=n;i++)
       for(j=1;j<=n;j++) 
           for(t=1;t<=8;t++)
           P[i][j]+=O[i][t]*c[t][j];  // To calculate the result of the transformed Yin Matrix multiplied by the inverted Yang Matrix
    
    for(i=1;i<=n;i++)
    {
    	for(j=1;j<=n;j++)
       	cout<<P[i][j]<<" ";          // Output the matrix of Yin Matrix multiplied by the inverted Yang Matrix£¨n*n£©
       	cout<<endl;  
    }
       cout<<endl;   
    
    for(i=1;i<=n;i++)
    {
       for(j=1;j<=8;j++)
       {
       	 if(j==1) Q[i][j]=O[i][8];
       	 else Q[i][j]=O[i][j-1];      //  The transformed Yin Matrix after it circles to the next grid at the clockwise direction again
       }
    

    }

    for(i=1;i<=n;i++)
       for(j=1;j<=n;j++) 
           for(t=1;t<=8;t++)
           R[i][j]+=Q[i][t]*c[t][j];  // To calculate the result of the transformed Yin Matrix multiplied by the inverted Yang Matrix
    
    for(i=1;i<=n;i++)
    {
    	for(j=1;j<=n;j++)
       	cout<<R[i][j]<<" ";          //  Output the matrix of Yin Matrix multiplied by the inverted Yang Matrix£¨n*n£©
       	cout<<endl;  
    }                               // In total 8 Matrices£¨n*n£© used for the next statistics. 
    
           return 0;
       }`
    
    Downloads