Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 8th, 2005, 4:16 PM   #11
Kaja Fumei
Hobbyist Programmer
 
Join Date: Oct 2005
Posts: 134
Rep Power: 4 Kaja Fumei is on a distinguished road
Quote:
Originally Posted by Rapajez
Hey everybody, first time posting here.

I need to know if there's any method for locating a column of zeros in a matrix inputed to C++ (or any other language for that matter). At this point I really only need to know whether or not it's possible.
Do you want where the whole column/vector is all 0 (what I thought you meant) or just a certain number of consecutive 0's in the column (like UnKnown X's algorithm)?
Kaja Fumei is offline   Reply With Quote
Old Dec 8th, 2005, 6:34 PM   #12
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Consider for a moment that your matrix, however implemented, may be addressed as matrix [r][c], where r is a row number and c is a column number. Address matrix [r][cDesiredColumn] for every r from rMin to rMax. If, at any point, you find a non-zero value, you do NOT have a column of zeroes; you're finished. If you reach the end without finding a non-zero element, you have a column of zeroes. Expand on that if you have further requirements or if your requirements weren't correctly expressed.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:36 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC