Algorithm and Programming
I need to get done for these parts. There is a separate file to assist for the first part of project.
//
// Makematrix.cpp
//
//
//
//
#include
#include
#include
#include
#include
using namespace std;
int main(int argc, char *argv[])
{
if ( argc < 4) { cout << "Foure inputs needed:\\ 1: Number of Rows; 2: Number of Columns; \\ 3: Sparsity (between 0-100) \\ 4: Name of output files \n";}
int rows=atoi(argv[1]);
int cols=atoi(argv[2]);
int sparsity=atoi(argv[3]);
//name of matrix is given in argv[4];
if(sparsity>100){sparsity=100;}
//Get the numbers
srand(time(NULL));
int k=0;
int zs=ceil(rows*cols*(double)sparsity/100.00); //nmber of zeros.
int A[rows][cols];
for (int i=0;i