Following is a matrix multiplication code written in MPI (Message Passing Interface) which could be run on CPU cluster for parallel processing. This has been successfully tested with two square matrices, each of the size 1500*1500. |
+2 forum
5 | ||

I have nothing to start with.. *sigh& |
+0 forum
5 | ||

I need to create a MULTIPLICATION TABLE with a Start Number and End Number and How many times it should be multiplied. Any tips for the looping? Thank you! |
+0 forum
1 | ||

i'm a newbie in java and i got an assignment to do and i don't know how to start ... the problem is: Write a program that will compute for the product of two numbers without using the * operator.. Sample Output: Enter Num1 :___ Enter num2 :___ Product is :___ hope you'll help me in this one :) :) |
+0 forum
11 | ||

Good Day guys, I wanted to make a multiplication table but it seems not that easy for a newbie like me. Mind taking your time and see what I am missing in my code? It would be a great help. Here's the code: #include<iostream> #include<conio.h> using namespace std; void initArray(int arg1[50][50], int r, int c) { int val=1; for(int row=0; row<r; row++) { for(int col=0; col<c; col++) { arg1[row][col]=val; val++; } } } void mulTable(int arg1[50][50], int r, int c) { for(int row=0; row<r; row++) { int mul=0; for(int col=0; col<c; col++) { mul = mul * arg1[row][col]; cout << … |
+0 forum
2 | ||

Hello below is my code for a program that reads in integers rom keyboard input and creates two polynomials from that input and then does some maths functions on them. I've got the addition working, having trouble with the multiplication though. Any help would be appreciated. thanks import java.util.*; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.text.*; import java.io.IOException; import java.util.Iterator; import java.util.LinkedList; import java.util.Scanner; public class Polynomial { private Monomial head; private int TOLERANCE = 0; /****************** the Monomial (inner) class ********************************/ private class Monomial { private DecimalFormat precision = new DecimalFormat("#.####"); private int deg; // degree of polynomial … |
+0 forum
7 | ||

Code Snippet
Optimizing Matrix Multiplication 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 forum
11 | ||

Ok, so I just made this account because I'm super stuck. Basically I need to create a math quiz that takes a users input (1 through 12), have it spit out a question, i.e What is 5 x 12? however if the user enters 5, it must randomly generate a question asking the user his 5x tables. i.e What is 5x3? What is 5x7? and so on and he needs to enter the correct answer, after which it will display correct or incorrect. I am having trouble getting the user input part. So far my code allows for him to … |
+0 forum
2 | ||

I'm quite new to programming and i'm trying to write a formula to work out the capacitance of capacitors - and is what I have below. I then want to convert the value I have (in pico farrads) into micro farrads. Here's what I have so far: while True: x=float(input("First number: ")) y=float(input("Second number: ")) z=float(input("Third number: ")) x=int(x) y=int(y) z=int(z) print(int(str(x)+str(y))*10**z) replay=input("Would you like to calculate again? (yes/no) ") print('\n') if replay=="no": print("...Terminated Program.") break print('\n') I want to assign the variable 'pf' to the result of line 11, so that I can then multiply the result by *10**-3. … |
+0 forum
3 | ||

Program Design |
+0 forum
1 | ||

Below is my code so far that ask user for how many numbers they want to input. This program can calculate average based on the numbers that the user input but I also need it to find the product or multiplication of all the numbers entered. I know how to do if I set the number size but since the user deteremines that I don't know how to do the multiplication. #include<iostream> using namespace std; int p, N = 0.0, sum =0; float average = 0.0; int main(){ cout<<"Enter the number of integers you want to enter: "; cin>>N; for … |
+0 forum
4 | ||

Hi All, I am trying to the following: The code is written in ASP, the output is from a database. I am trying to multiply the QTY and RATE#2 and display total with each order in the returned data. This relates to the last td's in the output. I also want to data to 2 decimal places(currancy) Anything else required please let me know Thanks in advance David <tr> <td height="30"><a href="/dashboard-fullscreen/individual/contracts/view.asp?Allow=f875eba085941cc78509bd3482dc0294&Contract=<%= rowCrossHire("CONTNO") %>" target="_blank" title="View <%= rowCrossHire("CONTNO") %>"><%= rowCrossHire("CONTNO") %></a></td> <td height="30"><%= sonNo %></td> <td height="30"><%= rowCrossHire("ACCTNAME") %></td> <td height="30"><%= rowCrossHire("ITEMNO") %></td> <td height="30"><%= itemDescription %></td> <td align="center" height="30"><%= … |
+0 forum
10 | ||

I am trying to make a calculator to calculate your age in dog years, the following is the code I have so far, minus the html portion of it <?php if (!isset($_POST['your_age']) ) { header("Location: dog_form.html"); exit; } if ($_POST['your_age'] == "your_age") { $result = ($_POST['your_age'] *7; if ($_POST['your_age'] >= 100 && $_POST['your_age'] <= 199) { $result = "An Old Dog"; } else if ($_POST['your_age'] >= 200 && $_POST['your_age'] <= 299) { $result = "Wicked Old Dog"; } else if ($_POST['your_age'] >= 300) { $result = "Ancient Dog"; } ?> <HTML> <HEAD> <TITLE>Calculation Result</TITLE> </HEAD> <BODY><H2><center> <P>The result of the … |
+0 forum
11 | ||

Hi, In an application im making, I need to square a decimal value in a text field to then use in other calculations later, but when the compiler squares the value it ignores the decimal points, treating 1.85^2 as 185^2 and returning 34225 rather than 3.4225. What am I doing wrong? Here is the code: Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click Dim heightSquared, height As Double height = txtHeight.Text heightSquared = (height * height) lblBMI.Text = heightSquared End Sub This is the test code im using, and have tried using height^2 and got the same result. |
+0 forum
10 | ||

hi all, how to do multiplication matrix with iteration and stop iteration if value >= 5? $data = array( array(1,-0.52836), array(-0.52836,1,), ); for ($i=0;$i<count($data);$i++) { for ($j=0;$j<count($data[$i]);$j++) { $R2[$i][$j] = (($data[$i][0]*$data[0][$j])+($data[$i][1]*$data[1][$j])); } } echo "<pre>"; print_r($R2); echo "</pre>"; result: 1.279164732 -1.056721269 -1.056721269 1.318545629 how to do nested loop from process above until the result: iteration 1: $data * $data = 1.279164732 -1.056721269 -1.056721269 1.318545629 iteration 2: $R2 * $R2 = 2.752922251 -2.703440873 -2.703440873 2.752921564 iteration 3: result($R2 * $R2) * $R2= 6.378224523 -6.367216988 -6.367216988 6.378222905 loop break because value array >= 5 please help me :3 |
+0 forum
1 | ||

Hello, As may be apparent from my previous posts, I am in a "If its worth doing, its worth overdoing" sort of competition with a friend of mine. Our goal is arbitrary precision integer arithmetic. I think I am close to getting the data storage working, but now I want to look at the complexity of my multiplication step. I already have it so that if the number is <MIN_MUL_NUM bytes in size then I use "Grade-School multiplication". When my number goes above that, but is still stored in an array (thus <8^sizeof(size_t) bytes) I use Toom-Cook (with k=5 if … |
+0 forum
2 | ||

Code Snippet
Matrix Multiplication - C++ Program Here is a small--complete--program that includes a sub-routine that inputs two matrices and then multiplies them. Notes: * 1) I happen to like taking input from a text file. It eliminates the need to type input from the console, especially when debugging, it prevents the possibility of making typos. * 2) The sub-routine includes several checks to make sure the array sizes are correct. These checks are not necessary for this particular program, but the checks were added in case the sub-routine is ever copied and used somewhere other than this program. * 3) To make the code more concise, … |
+3 forum
4 | ||

Hi, I'm using this SQL statement to retrieve Value and Date which will then be plotted on a graph: SELECT DISTINCT assets.SEDOL,assets.Quantity,stock_names.value,stock_names.Fileid,date_header.dateid FROM assets,stock_names,date_header WHERE assets.Client_ref = '$clientref' AND stock_names.SEDOL = assets.SEDOL AND date_header.fileid = stock_names.fileid I'm also selecting Quantity. Instead of having to multiply out the arrays, how can I multiply value and quantity inside the SQL statement and then just return Value (multiplied by quantity)? |
+0 forum
2 | ||

Hello all... I want the multiplication of the same matrix but in third, forth, fifth... degree. I have made the C++ program and this is the code: #include <stdio.h> #include <stdlib.h> #include <iostream> using namespace std; #define WIDTH 3 #define HEIGHT 3 void main(){ int a[HEIGHT][WIDTH]; int b[HEIGHT][WIDTH]; int n; for (int i = 0; i <= HEIGHT - 1; i++) { for (int j = 0; j <= WIDTH - 1; j++) { //cout << "\n Intput a[" << i << "][" << j << "]: "; //cin >> a[i][j]; a[i][j]= rand()%100 + 1; } cout << "\n"; } … |
+0 forum
2 | ||

Hey guys, I'm stuck. What I want to do for a school project is demonstrate how bacteria divides and multiplies on an exponential scale. What I want to do is have a TreeView, and when the user clicks the 'Populate' button, a tree will be generated. I want the tree to start with one node, which will split into two, then each one of those nodes will split into two, as will each of the next, so on so forth - like you can see in the fibonacci tree diagram [here](http://www.cse.unsw.edu.au/~billw/dictionaries/pix/fibonacci_tree.png). How would I go about doing this? |
+0 forum
1 | ||

I am creating a method to multiply 2 polynomial expressions together such that: `3x^5 * 2x^3 = 6x^8` -> Where the coefficients are multiplied and the exponents are added together. My test case for this would look something like the following @Test public void times01() throws TError { assertEquals(Term.Zero, Term.Zero.times(Term.Zero)); } I should also add that `Term.Zero = (0,0)` and `Term.Unit = (1,0)` So anything multiplied by `Term.Zero` is `Term.Zero` and anything multiplied by `Term.Unit` returns itself as `Term.Unit` effectively is 1. public Term times(Term that) throws CoefficientOverflow, ExponentOverflow, NegativeExponent { return null; } This is the `times` method. I'm … |
+0 forum
7 | ||

matrix multiplication program |
-1 forum
2 | ||

I need to design and implement an application that produces a multiplication table, showing the results of import java.util.*; import java.text.*; public class MultTab7 { //---------------------------------------------------------------------------------------------- // Creates a multiplication table. //---------------------------------------------------------------------------------------------- public static void main (String[] args) { int MAX = 12; for (int r=1; r<=MAX; r++) { for (int c=1; c<= MAX; c++) { cout<<r*c; } cout <<'\n' } } } multiplying the integers 1 through 12 by themselves. |
+0 forum
8 | ||

for (k=0; k<M; k++) for (i=0; i<N; i++){ c[i][k]=0.0; for(j=0;j<P;j++) c[i][k]+ =a[i][j]*b[j][k]; I have implemented the above sequential matrix-matrix multiplication algorithm, but i'm not sure about implementing a method to display the output to verify that the algorithm works as expected. |
+0 forum
3 | ||

This Is my Question : Using loop statement, write a VB .NET program that prompts an integer in the range of 1 to 10 (both inclusive) from the user in an input box, and prints a multiplication table of the integer entered. For example, when the user enters 8, your program should display the following: > 1 2 3 4 5 6 7 8 > 1 1 2 3 4 5 6 7 8 > 2 2 4 6 8 10 12 14 16 > 3 3 6 9 12 15 18 21 24 > 4 4 8 12 16 … |
+0 forum
2 | ||

/***** The prompt i have is : use a class with 3 member functions named InputMatrix, Calculate, and OutMatrix. The program will prompt the user to (e)enter the matrix data, (c) to calculate the matrix multiplication, (d) to display the input and output matrices, and (q) to quit. no exit() or abort() commands are to be used. no global variables allowed. I have created the Menu for users to enter either e, c, d or q...I have also created the correct functions for input, output and calculation. i am having trouble with how to put all the functions in the … |
+0 forum
3 | ||

hi Am trying to write a C-code that multiply two matrices but i want the elemnets of every matrix is random number using time function main() { srand ( time(NULL) ); int m1[10][10]; m1[10][10] = rand() % 10; scanf("%d%d",&r1,&c1); scanf("%d%d",&r2,&c2); if(r2==c1) { . . . . } this is the first matrix only when i output tihs matrix printf("First Matrix is :n"); for(i=0;i<r1;i++) { for(j=0;j<c1;j++) printf("%dt",m1[i][j]); printf("n"); } i get rapish numbers in some elements like that 5777072 5767844 3 1971339732 and i don't know why that any one know ?? thx,,, |
+0 forum
2 | ||

Hello problem i am having is when trying to multiply polynomial 1 by polynomial 2 polynomial 1 gets mutliplied by the first term in polynomial 2 and not by each term in polynomial 2. Below is my code: ~~~~ /********************************************************************************************* * Multiplies Polynomial 1 to Polynomial 2 * The method does not change the original polynomial. **********************************************************************************************/ public Polynomial multiply(Polynomial poly) { Polynomial res = clone(); for(Monomial tmp2 = poly.head; tmp2 != null; tmp2 = tmp2.next) //-------- LINE B for(Monomial tmp = res.head; tmp != null; tmp = tmp.next) res.addTerm(tmp.coeff *= poly.head.coeff, tmp.deg += poly.head.deg); double num = 0.5; for(Monomial … |
+0 forum
1 | ||

So im trying to create a times table: Write a program to print a multiplication table (a times table). At the start, it should ask the user which table to print and how high the table should go. The output should look something like this: Which multiplication table would you like? 5 How High? 10 Here’s your table: 5 X 1 = 5 5 X 2 = 10 5 X 3 = 15 5 X 4 = 20 5 X 5 = 25 5 X 6 = 30 5 X 7 = 35 5 X 8 = 40 5 X … |
+0 forum
3 | ||

Trying to figure out why this SIMPLE math function will not work. If anyone can help me that would be great....Thanks [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Calc Price</title> <SCRIPT LANGUAGE="JavaScript"> function doMath() { var one = eval(document.theForm.elements[0].value) var two = eval(document.theForm.elements[1].value) var prod = one*two var outp = "" } document.getElementById('outtab').innerHTML = outp } // End --> </SCRIPT> </head> <body> <div> <form name="theForm"> <p>Please select:</p> <select name="one"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> </select> <p>Price</p> $<input name="two" DISABLED type="text" size="4" value="2.00"> <BR>Total:<SPAN ID="outtab"></SPAN> <br> … |
+0 forum
8 |

The End.