167 Topics

Member Avatar for
Member Avatar for suraj_p

When i run this program it takes more values and prints less values.... this runs on Dev C++([url]www.bloodshed.net[/url]) [CODE]#include<iostream> using namespace std; #include<conio.h> int main() { int arr[5][5],i,j,k,l; cout<<"Enter matrix row wise"; for(i=0;i<=3;i++) { for(j=0;j<3;j++) { cin>>arr[i][j]; } } for(k=0;k<3;k++) { for(l=0;l<3;l++) { cout<<" "<<arr[k][l]; } printf("\n"); } getch(); } …

Member Avatar for suraj_p
0
179
Member Avatar for KKR_WE_RULE

I've made a library for Delphi to work with matrices. Everything in the library works perfectly as intended save the Matrix Inversion Procedure. I've used the Gauss-Jordan method of Matrix Inversion & everything works excellent for square matrices upto 7x7. From 8x8 onwards, I get a 'Invalid Floating Point' Error …

Member Avatar for Mikav6
0
502
Member Avatar for Petan Kl

Hello, I am wondering if there is an efficient way (other than for cycle) of solving following task: I need to multiply e.g. two matrices and at every point in the matrix there is an array. The two matrices shall be multiplied using matrix multiplication and when the elements of …

Member Avatar for Gribouillis
0
214
Member Avatar for somon

hi everyoen i've a matrix array with some value, i want to shaw each of them in matrix type in my form, how can i do it? can i use DataGrid view for this? and if yes ... what is method..

Member Avatar for Ancient Dragon
0
265
Member Avatar for Haranadh

Can some one suggest best way to calculate the huge matrix. Example: [CODE] const int NUMPAT = 1212; const int NUMIN = 6; const int NUMHID1= 13; const int NUMHID2 =15; const int NUMOUT = 12; #define rando() ((double)rand()/(RAND_MAX+1)) [/CODE] Below are----- [CODE] double Input[NUMPAT+1][NUMIN+1]; double Target[NUMPAT+1][NUMOUT+1]; double SumH1[NUMPAT+1][NUMHID1+1], WeightIH1[NUMIN+1][NUMHID1+1], …

Member Avatar for mike_2000_17
0
312
Member Avatar for mashar

Hello all, I am currently a student doing an end-of-year software project - and I need some help. I am currently trying to return a 2D array from a function contained in a header file. The function is called from the main() and asks the user to input the location …

Member Avatar for mashar
0
142
Member Avatar for comSysStudent

Hi all, I have a programming assignment to store sparse matrices using a list<list <myclass> >. I have pretty much everything nailed down but I'm going wrong at some point, the output is incorrect. Instead of giving me 4 lines with the column position and value of non zero values …

Member Avatar for comSysStudent
0
192
Member Avatar for spixy

I have a problem on programming, its not really my assignment, but my friends... i just thought i can resolve this at C, because i got some backgrounds on it.. but i can't do it my compiler is dev c++ the code must be on C++ not C can i …

Member Avatar for spixy
0
2K
Member Avatar for sparkthesunoff

So i have a matrix. (n rows, m cols), and my program has to count the number of rows, where all the cols were >0. For eg. there are n cities, and m bird species. The program has to count the number of cities, where all the bird species (m) …

Member Avatar for jonsca
0
104
Member Avatar for toritza

hello. I am quite new in python so i have a question. I have a csv file in which i have names of 30 cities and their coordinates(lat and long). i want to generate a distance matrix for these cities. How can i do this ?

Member Avatar for Gribouillis
0
2K
Member Avatar for 24x24

Ok, I have three main tasks. One: I need to create a 2 dimensional array that is 8x8 and consists of randomly generated numbers that range from 0-3. I'm assuming the Math.random will be used inside of a for loop with a limit set for length(8) and range(0-3) somehow? Two: …

Member Avatar for 24x24
0
257
Member Avatar for LexLieberthal

My friend needs a program that will: 1. Ask the user for the size of the matrix. The choices are 2x2 or 3x3. 2. Ask the user for the operation to perform. The choices are addition or subtraction. 3. Let the user input the numbers for the first matrix. 4. …

Member Avatar for LexLieberthal
-1
147
Member Avatar for Dasharnb777

Hi, everyone. I need to find matrix n*n (or 5*5) determinant. I have a function translated from Pascal, but there's INDEX OUT OF RANGE EXCEPTION. Could somebody help me? Here's my code: [CODE]public static double DET(double[,] a, int n) { int i, j, k; double det = 0; for (i …

Member Avatar for Dasharnb777
0
688
Member Avatar for Dasharnb777

Hi, I have a matrix. And I need to get 1D arrays from my matrix. For example, I have follow matrix: 123 456 789 So it looks like 3 [B]arrays[/B]: 147, 258, 369. But I got "Index out of range exception" in this code: [CODE] int[] b = new int[n]; …

Member Avatar for Dasharnb777
0
135
Member Avatar for blessed87

I have the following code: [CODE]for (int w=0; w<10; w++) { //some lines of code unsigned long num = x.to_ulong(); cout << "Decimal form is: " << num << endl; } [/CODE] Now what I want is, to make a matrix which will have these values of num, column wise. …

Member Avatar for djarn
0
179
Member Avatar for blessed87

[CODE]std::vector<std::vector<unsigned long> > matrix(15); // 15 rows typedef std::vector<std::vector<unsigned long> >::iterator it_type; it_type row = matrix.begin(); for (int w=0;w<10;w++) { //some lines of code unsigned long num = x.to_ulong(); cout <<"Decimal form is: " << num<< end; // if we've hit 15 items in the current row (i.e. 15 columns), …

Member Avatar for WaltP
0
203
Member Avatar for negneg

Hi Everyone, I am trying to compile a code and I keep getting error C2064: term does not evaluate to a function taking 1 arguments here is my code(actually I got it from a book),can anyone help me what is wrong? thanks Negin #include <iostream> #include <math.h> using namespace std; …

Member Avatar for negneg
0
203
Member Avatar for HeartBalloon

I have to write a code to build an array like this: 1,6 1,0 2,3 3,4 5,6 4,5 7,6 1,2 9,7 Where the numbers are coordinates which have to be "separated" when taken in consideration Like: cell[2][2]---> x=5 y=6 I decided to make a char array, so that with atoi() …

Member Avatar for HeartBalloon
0
110
Member Avatar for stroper

Hye everyone, I am trying to make a 2d-char array, fill it with random letters(chars) and print it. If I do it like this I get a ArrayIndexOutOfBoundsException: 0. I am a newbee. I import my prefs(width, height) from static getters in the class preferences. Can anyone help me please? …

Member Avatar for stroper
0
472
Member Avatar for sandwich88

hi everyone this is my first post and yes, im just starting with cpp im using devc++ so i have this homework which i could get done for its due date but still it would really help me to understand more about cpp if i could get it done but …

Member Avatar for sandwich88
0
135
Member Avatar for ninikobb

Hello everybody! Im a new to this site. I wonder how can I get the row dimension of a matrix. For example i have a matrix double[n,m] and i want to get n provided m is unknown. So what property of method should i use??? Thank you

Member Avatar for ddanbe
0
121
Member Avatar for Castiel1631

I am trying to create an abstract data type for matrices. I have a function matrixInit to dynamically allocate memory for the structure and for the array. matrixCopy copies one matrix into another. there are functions to subtract, add and multiply matrices that return a pointer to memory where the …

Member Avatar for Thaylo
0
1K
Member Avatar for halil.burak

Frame complete game, only the outer edges of a square drawn on the table is a game played with 2 players. Sequence of a square drawn from the player wants to draw a non-edge. Underline that this edge of the square is not the last edge of the square is …

0
122
Member Avatar for Hawkeye Python

Hello :) I'm from Brazil, so sorry about my english. This is the first code I post here - I'm a begginer in Python. It is a function to calculate determinants of matrices. You can attach it to a class if you wish. Please leave a comment if you wish …

Member Avatar for Gribouillis
0
3K
Member Avatar for tKc

Hokay so, i gotta make a program that reads an adjacency matrix from a data file and then outputs which nodes are adjacent to the others. In the data file there are 0's and 1's, 0 means that they are not connected and a 1 means that they are. I …

Member Avatar for mrnutty
0
481
Member Avatar for bookmark

Hi, I'm trying to get this program to read a file which contains a matrix. I am trying to output a text file which has the matrix of the input file but with the average of each row. Every time I enter the name of the inputFile and the outputFile …

Member Avatar for Fbody
0
210
Member Avatar for sallubhai

Hi, How can I print this figure if I have an array like this? It should be a for-loop but don´t know how. [CODE] labyrinth = \ [[0,0,0,0,0,0,1,0], [0,1,0,1,1,1,1,0], [0,1,1,1,0,1,0,0], [0,1,0,0,0,0,0,0], [0,1,1,0,1,1,1,0], [0,0,1,1,1,0,0,0], [0,1,1,0,1,1,1,0], [0,1,0,0,0,0,0,0]] [/CODE] figure: ############. ## ## ##. . . . ## ##. . . ## #### …

Member Avatar for TrustyTony
0
154
Member Avatar for RobBobSmith

Hello all, I'm having trouble with making a 2d vector array class. Would anyone have time to help with a couple of questions? I think my problem is with overloading (). I notice that this: [CODE]template <typename T> T& Array2d<T>::operator() ( int x, int y) { if( x >= rows …

Member Avatar for RobBobSmith
0
190
Member Avatar for Caeon

This is what my program is supposed to do: [LIST=1] [*]Print the vector (m1) [*]Print the matrix (m2) [*]Multiply the vector and matrix together and display results [/LIST] The only thing wrong with my program is that I can't quite get the right results displayed. The correct display of values …

Member Avatar for Caeon
0
12K
Member Avatar for Goshutu

my program is made to enter a matix,in which it finds all of the column`s minimum numbers which are[COLOR="Red"] >0[/COLOR] and then put them under the last row.i have sucseded entering the array and puting it out,but i think my IF is wrong somehow.I have tried initialising the last row …

Member Avatar for Goshutu
0
204
Member Avatar for kirennian

I'm currently having an issue with moving the camera around the z-axis (roll). For debugging purposes, I have an object with which I've tested with all 3-axis rotation and movement and it's working as expected; the object in question as well as the camera class superseed a positions class for …

Member Avatar for dineshguru
0
1K
Member Avatar for matkod

hi, I'm creating a game with pygame and i want to create a matrix that will represent the map(where each tile will be). my pygame code is ok, because if i create the map without loading the tilemap (the matrix file) the game runs ok. that would be good but …

Member Avatar for Gribouillis
0
185
Member Avatar for thm

I'm trying to write a matrix multiplication program that takes in an int N on command line, creates two NxN matrices A & B, randomly populates them with ints, and then computes the result of multiplying A and B. I wanted to avoid malloc, but the first version started segfaulting …

Member Avatar for thm
0
323
Member Avatar for bflack

Given the matrix representing a relation on a finite set, determine whether the relation is reflexive or irreflexive.. Need your help!

Member Avatar for bflack
0
493
Member Avatar for bflack
0
80
Member Avatar for applepomme

for (i=0, i<imax, i++) { // ... Array< complex<float>, 3 > matrix(x,y,z); // x,y,z are large and vary in each loop // ... // matrix <=== values for each element assigned // ... // now want to write "matrix" in a single binary file. // later, this matrix can be …

Member Avatar for chiwawa10
0
191
Member Avatar for applepomme

I used this to write the matrix into a file: int Nx, Ny, Nz; Array <complex<float>, 3> matrix(Nx, Ny, Nz, ColumnMajorArray<3>()); ...get matrix data... fstream outbin(outname.c_str(),ios::out|ios::binary); outbin.write(reinterpret_cast<char *>(matrix.data()),sizeof(complex<float>)*Nx*Ny*Nz); outbin.close(); Then, I used this to read this matrix, works fine, values and orders are correct too: Array <complex<float>, 3> matrixb(Nx, Ny, …

0
85
Member Avatar for marvin42

I am using [URL="http://msdn.microsoft.com/en-us/library/system.drawing.drawing2d.matrix.aspx"]matrix class[/URL] to perform image transformations.Problem is that I want to do a perspective transform, which requires a 3x3 matrix. [COLOR="Green"]system.drawing.drawing2d.matrix[/COLOR] behaves like a 3x2 matrix. Here's a short code extract of what I use the matrix for: [CODE] Graphics my_graphics= Graphics.FromImage(my_image); my_graphics.Transform = my_matrix; my_graphics.DrawImage(my_image2, new …

Member Avatar for Momerath
0
187
Member Avatar for guru_iyer

I'm trying to do addition of matrices using pointers. But, in 3x3 matrix, only the first row of the matrix gets added, while the rest are zero. Please help me correct this. Thank You! My code is as follows :: [CODE] #include<stdio.h> #include<conio.h> int a[10][10],b[10][10],c[10][10]={0}; int i=0,j=0,k=0; int r1,c1,r2,c2; void …

Member Avatar for Adak
0
3K
Member Avatar for pc0019

Hi! I am using the Boost uBlas interface for matrices and I'd like to be able to create matrices with the following syntax (or similar): [CODE] typedef boost::numeric::ublas::matrix<double> Matrix; //for clarity Matrix mat = {[1,1,1],[2,2,2],[3,3,3]}; [/CODE] The actual matrix should be 3x3 and look like the following - 1,1,1 2,2,2 …

Member Avatar for vijayan121
0
118
Member Avatar for suguna07

Hi everyone, Can someone help me to solve this question? im attaching the question as i cant post the matrix here. Thank you

Member Avatar for Xufyan
0
69
Member Avatar for RHodgett

[CODE] for (int i = 1; i <= numberofmatricesrequired; i++) { string number = Convert.ToString(i); Matrix (matrixnumber+number) = new Matrix(matrixsize, matrixsize); } [/CODE] Basically I have x amount of matrices I need to establish of y by y size. I was hoping to name the matrices: matrixnumber[B]1[/B] matrixnumber[B]2[/B]..matrixnumber[B]n[/B] I cannot …

Member Avatar for PierlucSS
0
97
Member Avatar for miac09

Hi, I have the following files and can match but, am having trouble with getting the output to write correctly to a data matrix format that I need and would appreciate any help with getting the code right. File 1 has a list of numbers and Files 2, 3 and …

Member Avatar for woooee
0
199
Member Avatar for Ja14

This is as much of a question about algorithm as it is about code. I’m training monkeys to input data into a keyboard in the form of a table. I have created a special keyboard with nothing on it but numbers 0 - 9, a period, tab key and a …

Member Avatar for Ja14
0
130
Member Avatar for jman212

I have this 2d array that sorts the rows but i can't sort the column.. i can't figure it out for the life of me. PLEASE HELP Please enter size of row between 1 - 20: 5 Please enter size of column between 1 - 20: 5 Your matrix is …

Member Avatar for sneaker
0
144
Member Avatar for Annettest

Hi everyone: I have written C++ code for populating a matrix/2D array with calculation results. Each column of the array represents results for a distinct time step. My problem arises because the rows of my results vector do NOT correspond to the rows of the matrix. The matrix includes extra …

Member Avatar for Annettest
0
106
Member Avatar for sana zafar

Hey, Im trying to write a program that using gauss-jordan elimination to solve a set of linear equations.It reads in two files names for matrix A and C. I have to first form an augmentes matrix (A|C) and then do the elimination.Can any one help me by telling how to …

Member Avatar for mrnutty
0
119
Member Avatar for tcstom

Hi, I am attempting to create a dynamic array using realloc in 2 dimensions. Currently i have managed to get it to work using realloc to dynamically resize the amount of rows but when I attempt to use realloc to dynamically resize the amount of columns per row I keep …

Member Avatar for tcstom
0
4K
Member Avatar for callie

Hey. I need a method that creates a matrix from an array, for instance: ({10, 11, 12, 13}, 2) should return {{10, 11, 12}, {13}}. [code]public class Matrix{ public static int[][]toM(int[] array, int a){ int[][]matrix = new int [(array.length)/a][a]; for (int i = 0; i < array.length; i++){ int value …

0
68
Member Avatar for jonyshub

Hi everybody! Sorry for my bad english! I have a matrix of integers with a maximum length 6 digits. I must to write program, that checks whether a number is found in the section above the main secondary diagonal of this matrix. I'm beginner in C + + and I …

Member Avatar for farag
0
145

The End.