**A newbie would appreciate if someone could give him a pseudocode or any kind of explanation for the part of the code where the actual algorithm for matrix determinant is written.** using System; namespace Determinant { class Program { public static double DET(int n, double[,] Mat) { double d = 0; int k, i, j, subi, subj; double[,] SUBMat = new double[n, n]; if (n == 2) { return ((Mat[0, 0] * Mat[1, 1]) - (Mat[1, 0] * Mat[0, 1])); } else { for(k = 0; k I've been here before trust me, you don't want to see my current code. :P also, please don't provide math references such as wikipedia... I can read programming, not math. meaning I can read v = sqrt( x ), not: *insert math algorithm here* +0 **Problems 1: Spiral matrix - Advanced** Source of the problem: [Here (not in English)](http://www.spoj.com/PTIT/problems/BCACM11B/) Spiral matrix is formed by filling number 1 in 1st row 1st column, after that, filling with increasing number by clockwise, example: 1 2 3 4 5 16 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9 Write a program that inform the value of cell (x, y) of a square spiral matrix sized n x n. *Input:* First row record the number of tests, not greater than 100. Each test record in one row, include … +0 For my own use, I'd like to develop a small Vector and a Matrix class, independent of some big libraries that exist out there. My question is: Should Vector and Matrix stay two independent entities or should I derive a Vctor frm a Matrix or a Matrix from a Vector? Any response is as always greatly appreciated. :) +0 I wan to wirte in cout << ... to have the matrix in output in the same format that I wrote it in text file like this: 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 class Classname { double data[3][3]; public: void Read(char *fname); void Writedata(); } void Classname::Read(char *fname) { int i, j; ifstream fin(fname); fin >> 3; // read the matrix for(i= 0; i<3; i++) for(j= 0; j<3; j++) fin >> data[i][j]; } void Classname::Writedata(char *fname) { // writes model to cout in same format it was read in cout << … +0 I have a 1000x24 matrix in a text file and i want to sum the adjoining columns of the whole matrix e.g. col1+col2, col2+col3, col3+col4,... col23+col24 and store these values in a separate text file. My code runs like this: #include int main() { int i,j; float a[100][24]; FILE *fp=fopen("D:\1980.txt","r"); FILE *fp1=fopen("D:\\sum.txt","w"); for (i=0;i<=99;i++) { for (j=0;j<=23;j++) { a[i][j]= a[i][j]+a[i][j+1]; } } for(i=0;i<=999;i++) { for(j=0;j<=23;j++) { fprintf(fp1,"%.2f\t",a[i][j]); fprintf(fp1,"\n"); } } fclose(fp); fclose(fp1); getch(); } for example if a matrix in file 1980.txt is like [1 2 3;4 5 6;7 8 9], the output in sum.txt should be [3 5;9 … +0 I was doing the class tutorial to have matrix multiplication from two dimensional arrays: X (3x2) and Y (2x3). package t7; public class Q5 { public static void main(String[] args) { int[][] matrix_X = new int [3][2]; int[][] matrix_Y = new int [2][3]; int[][] result = new int [3][3]; for (int i=0; i Untitled … +0 This Project is to implement some procedures doing the following: 1. Represent any graph using these input parameters: • A parameter to represent the graph by Adjacency Matrix, or Adjacency List. • A parameter to indicate whether the graph is directed, or undirected. • A parameter to indicate whether the graph is wieghted, or unweighted 2. Traverse the graph nodes and list them using both BFS, and DFS algorithms. 3. Determine the MST of any input graph, using Prim’s or Kruskal’s algorithm. 4. Implement Dijkstra’s algorithm to find the shortest path from a given vertex to all other vertices. 5. … +0 Optimizing Matrix Multiplication One time consuming task is multiplying large matrices. In this post we'll look at ways to improve the speed of this process. We'll be using a square matrix, but with simple modifications the code can be adapted to any type of matrix. The straight forward way to multiply a matrix is: [code]for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { for (int k = 0; k < N; k++) { C[i,j] += A[i,k] * B[k,j]; } } }[/code] Now it's not important to us in which … +7 I have a base class called Matrix which has a function transpose. I also have a derived class Matrix2 which is inherited publicly from Matrix class Matrix { public: Matrix(); ... Matrix Transpose(void); ... }; class Matrix2 : public Matrix { public: Matrix2(); ... }; In my main code, I tried this. vector <Matrix2> myMatrix2; vector <Matrix> *b = &myMatrix2; to do this b->transpose(); But I get the following error error C2440: 'initializing' : cannot convert from 'std::vector<_Ty> *' to 'std::vector<_Ty> *' What is wrong... What is the way to access the transpose function from Matrix class in vector? I … +0 This is really simple. Just take the last letter of the movie name in previous post & put another movie name starting with that letter. Eg.:- if i put "The Matrix -Reloaded" answer may be "Doom" so let's start. I put : The Matrix Revolution +0 Hi, I have an assignment. I need to write code in logic programming language SWI-Prolog. Its very hard and I am going to appreciate if you help me :D. This is the assigment: Print 2D array size of (width x height) in spiral order. More explanation and example: You have input, width and height that are integers. With this input program needs to print a matrix "spiral" of numbers, from 1 to (height x width). Height is size of column in "spiral" matrix Width is size of row in "spiral" matrix This is just an example: spiralmatrix(w,h). /*w - width, … +0 Hello, So I'm aware that OpenGL is Column major and DirectX is Row major, but how does that translate into a basic 1D array? So given the below visual matrix, what would the first 3 in the array of each platform and which 3 would be the x,y and z translation of each platform? |AA BA CA DA| |AB BB CB DB| |AC BC CC DC| |AD BD CD DD| What I'm trying to find out is if I was given a matrix pulled from either platforms, would a formula for one work with the other (x,y,z translation index stay … +0 I have an mxn matrix, that is stored in memory in an array: matA = new float[m * n]; // ... Assign values matA[0] = 1; matB[1] = 2; // ... After I finish with this array, I then need to create very similar array to store a new mxn matrix--the same matrix as before, but with each column shifted to the right. Let's call it matB. Am I better of to create a new matrix? matB = new float[m * n]; // ... Assign values matB[0] = 23; matB[1] = 1; matB[2] = 2; // ... Or is there … +0 Hi, I'm a beginner with Java, can anyone tell me where my error is, I'm sure there's something I'm missing here with the array logic: public void scalarMultiplication(int c) { for( int i=0; i <values.length - 1;i++){ for(int j=0; j < values.length - 1;j++){ values[i][j] = values[i][j] * c; } main: Matrix n = new Matrix(new int[][] { { 1, 0, -1 }, { 1, 3, 3 }, { -2, -4, 1 }, { 0, 0, 1 } }); n.scalarMultiplication(-1); my output: [-1, 0, 1] [-1, -3, -3] [2, 4, -1] [0, 0, 1] *The lost row of the matrix … +0 I was wondering if there is any way to do a single mysql query to do a count of filled positions in a multi-level structure to an indefinite depth. That sounds a bit cryptic, but this is what I would like to do if it is at all possible. we are working within a 3 x ___ matrix meaning level 1 has 3 positions level 2 has 9 positions level 3 has 27 positions and so on... If a sponsor wants to know how many positions are filled within his downline I would like to be able to provide that … +0 can any body please tell me that how to take input size of a matrix in 2 d array an then print the table of it.... sample output 1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 4 8 12 16 20 5 10 15 20 25 +0 please help me i need a dynamic array that get the information as a matris and give me the vertex degrees (sum every row).and send it to another matrix. #include "stdafx.h" #include<conio.h> #include<iostream> #include <stdlib.h> #include <string.h> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int k,sum; cout << "Enter the Graph vertex number: "; cin >> k; int i, j, *a, b[100]; a = new int [i][j]; cout << "your Gragh is" << k << " , " << k << ", enter your numbers:"<< endl; for (i = 0; i<k; i++) { for (j = 0; j<k; … +0 I need to write a code that is gonna remove a whole row/column in a matrix(either static or dynamic matrix) +0 Write a program that can do the following: addition of two matrices . subtraction of two matrices. multiplication of a matrix by a scalar. multiplication of a matrix by a matrix. +0 This Program prints the numbers in given array(Row-Major Order) in Spiral order. Ex: Order Is 3*4 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 Spiral Order Of Matrix is 11 12 13 14 18 22 26 25 24 23 19 15 16 17 21 20 +0 I cant figure out how to check the array for AND and OR. please, help, i got stuck my code: import java.util.Scanner; public class BooleanProduct import java.util.Scanner; public class BooleanProduct { public static void main(String[] args) { Scanner input = new Scanner(System.in); int[][] A = new int[10][10]; int[][] B = new int[10][10]; int[][] C = new int[10][10]; int m,n,p,q; System.out.println("Enter number of rows for matrix A : "); m = input.nextInt(); System.out.println("Enter number of columns for matrix A : "); n = input.nextInt(); System.out.println("Enter number of rows for matrix B : "); p = input.nextInt(); System.out.println("Enter number of columns for … +0 import java.util.Scanner; public class BooleanProduct { public static void main(String[] args) { Scanner input = new Scanner(System.in); int n = 10; int[][] A = new int[n][n]; int[][] B = new int[n][n]; //Fill A and B int m,n2,p,q; System.out.println("Enter number of rows for matrix A : "); m = input.nextInt(); System.out.println("Enter number of columns for matrix A : "); n2 = input.nextInt(); System.out.println("Enter number of rows for matrix B : "); p = input.nextInt(); System.out.println("Enter number of columns for matrix B : "); q = input.nextInt(); System.out.println("Enter elements for matrix A (by rows): "); for (int i=0 ; i < m … +0

The End.