473,324 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Comparing Matrix for common entry

Hi there,
I am looking forward to your help for comparing matrix in
C++
I want to find common elements between 2 or more different
matrices,using C++

for eg:

A= [1 1 4 4
1 2 3 4
2 4 3 3
2 2 3 3 ]

B= [ 1 1 4 4
1 1 4 4
2 2 3 3
2 2 3 3]

then resultant matrix should display

C= [ 1 1 4 4
1 0 0 4
2 0 3 3
2 2 3 3]
( here the resultant matrix contains the common element in place of
common element, and it contains 0 in place of uncommon element)

I also want to extend this for comparing more than 2 matrices
simultaneously

Please post/email your views

thanks
Nishant
ni*******@rediffmail.com

May 13 '06 #1
1 1442
why not just brute force?

"Nishant" <ni*******@rediffmail.com> wrote in message
news:11**********************@j73g2000cwa.googlegr oups.com...
Hi there,
I am looking forward to your help for comparing matrix in
C++
I want to find common elements between 2 or more different
matrices,using C++

for eg:

A= [1 1 4 4
1 2 3 4
2 4 3 3
2 2 3 3 ]

B= [ 1 1 4 4
1 1 4 4
2 2 3 3
2 2 3 3]

then resultant matrix should display

C= [ 1 1 4 4
1 0 0 4
2 0 3 3
2 2 3 3]
( here the resultant matrix contains the common element in place of
common element, and it contains 0 in place of uncommon element)

I also want to extend this for comparing more than 2 matrices
simultaneously

Please post/email your views

thanks
Nishant
ni*******@rediffmail.com

May 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

89
by: purifier | last post by:
The problem is to write a program in 'C' to find the greatest of 2 given numbers... Easy? huh here's the catch do not use 'if' or any conditional statements if u want it to be a little more...
10
by: Duncan M Gunn | last post by:
Hi, I need to store the following matrix of values: T U V A 2 1 1 B 2 - - C - - 2 Where (-) is an empty cell.
20
by: Frank-O | last post by:
Hi , Recently I have been commited to the task of "translating" some complex statistical algorithms from Matlab to C++. The goal is to be three times as fast as matlab ( the latest) . I've...
1
by: blazted | last post by:
I am trying to find our how I would compare two matrix's. I have two matrix and I want to find out if they are equal, less or greater than. I created a double loop to loop through and compare...
3
by: Pino | last post by:
HI all, I am learning c++ ( just 1 month) and would want an aid for a code. I have a integer vector of length N. ie 3 3 3 4 4 1
5
by: adam.kleinbaum | last post by:
Hi there, I'm a novice C programmer working with a series of large (30,000 x 30,000) sparse matrices on a Linux system using the GCC compiler. To represent and store these matrices, I'd like to...
2
by: Zhengzheng Pan | last post by:
Hi all, I'm trying to check whether a (stochastic/transition) matrix converges, i.e. a function/method that will return True if the input matrix sequence shows convergence and False otherwise....
0
by: saschaM | last post by:
Hello folks :) I am working on a certain piece of code and i've been searching for a sparse matrix library for c/c++ for quite a while. I have been freelance searching in the web and for older...
6
by: atemuoh1991 | last post by:
#include <stdio.h> #include <math.h> #include <malloc.h> #include <stdlib.h> #include <time.h> struct SMatrix { double** pValues;
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.