C :: Routines Library For Numerical Tasks

Jan 13, 2014

I am looking for C-libraries that would do numerical tasks with special emphasis on numerical differentiation of arbitrary order, numerical integration (Monte Carlo etc.) and interpolation. I would be grateful if you can provide me with some resources. By the way I already have Numerical Recipes but would like to have another resource at hand.

View 11 Replies


ADVERTISEMENT

C# :: DB Calls Via Tasks?

Jan 6, 2015

I have a multi-thred piece of code that should be fast. As I have to update a Database from time to time, I wonder if I do it in a prpoer manner with calls like this:

Task.Factory.StartNew(()=>update_execution_to_db(exec));

Those are my sporadic updates, my ongoing update have a queue and a dispatcher thread reading from the Q, I just don't want to use this overhead for the sporadic updates.

View 6 Replies View Related

C/C++ :: Implement Two Tasks Synchronized On External Event Using Mailboxes

Jan 21, 2014

I have to make a C++ program that implements two tasks synchronized on a external event using mailboxes. The first task, T1, reads integer from keyboard, and record them to a vector. The second task, T2, transforms the integer numbers in binary and shows them. External events that are synchronized tasks is typing an integer.

This is what i made so far.

#include <iostream.h>
#include <conio.h>
int v[50], n, i;long sum;
void citire(){cout<<"dati numarul de elemente al vectorului:";cin>>n;
for(i=1;i<=n;i++){cout<<"introduceti elementele vectorului: ";

[Code] ....

I don't know how to use tasks, and the program doesn't convert from int to bin..

View 14 Replies View Related

C++ :: Use Circular Linked List And Data Structures To Store Tasks

Mar 30, 2014

The program use a circular linked list and data structures to store the tasks.

- Every task should include a task name, a name for the person assigned to it, and the deadline for the task.
- Variables should be dynamic and their sizes should be determined at runtime based on the length of user input.
- You should implement the following functions (with appropriate arguments and return types) for your structure: add(), remove(), search(), and list().
- The add()function should add tasks alphabetically by task name. You do not need to implement any file operations.
- The search() function should be able search for a task by the task assignee name or the task name.
- The list() function should print records to the screen in the order they appear in the circular linked list.
- You should successfully deallocate all of the allocated memory before termination of your program.

View 4 Replies View Related

C++ :: Call Stack Should Include All Active Sub-routines?

Feb 4, 2015

I have a general question on Call Stack of Embedded uCs.

The Call Stack should include all the Active Sub-routines.

For example, in the following sequence:

Func 1 Starts -- Call Func2 --> Func 2 Starts -- Call Func3 --> Func 3 Starts --> YOU ARE HERE

The Stack should include the Return Addresses of Func 2's Body and Func 1's Body, Right?

At any certain moment (e.g. when the uC experiencing a SW Bug), Is it possible to have the uC to get all the Active Sub-Routines from the Stack and print them (e.g. for knowing it at the moment of Bug)?

It'd debug failures, when I don't work with a Debugger.

I know that Debuggers do that - i.e. show you the Call Stack at each moment - So I am wondering if I can get the uC to to it for me every time a bug occurs.

View 1 Replies View Related

C++ :: Data Fitting Routines (Sinus Or Linear Fit)

Feb 5, 2014

Looking for data fitting routines?

I want to fit datapoints with a sinus or with a linear fit.

View 3 Replies View Related

Visual C++ :: Calling Routines From Fortran 77 Using Win32 DLL

Aug 14, 2014

Is it possible to call VC++ routines using a Win32 DLL form fortran 77??

View 3 Replies View Related

C++ :: Separating Routines Into A Separate Implementation And Header File

Oct 18, 2013

I am trying to separate out particular sets of routines into a separate implentation and header file which can be compiled independently to the main program such that the program source consists of a file called customers.h, customers.cpp, and exercise_1_5.cpp

Each of the files should contain the following:

customers.h should contain the definition of the customer structure and the declaration of print_customers.

customers.cpp should contain the implementation (or definition) for print_customers.

exercise_1_5.cpp should contain an include of customers.h and the main program.

This is my original code from a single .cpp file

#include<iostream>
#include<string>
using namespace std;

[Code].....

The error messages I am getting from the compiler on the customers.cpp file:

C:UsersBenDocumentsCS264lab3customers.cpp:5:22: error: variable or field 'print_customers' declared void
C:UsersBenDocumentsCS264lab3customers.cpp:5:22: error: 'customer' was not declared in this scope
C:UsersBenDocumentsCS264lab3customers.cpp:5:32: error: 'head' was not declared in this scope

View 6 Replies View Related

C++ :: How To Put Values Of Array In Numerical Order

May 20, 2014

im trying to make a statistics program and i have an array holding all the users numbers. The array has 10 elements and i was wondering how i could put these elements in order from smallest to largest.

View 18 Replies View Related

C++ :: Sorting Numerical Array Error

Nov 25, 2013

Why this wont run? I'm getting the cant convert int* to const char error but i do not know why?

I'm trying to create a program that creates an array of 100 ints between 0 and 250 and then sorts them using a separate function, I've gotten this far

#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include <cstring>

using namespace std;
void quicksort (int *items, int len);

[Code] ....

View 3 Replies View Related

C++ ::  Sorting Array To Numerical Order?

Nov 25, 2014

I need to find the Mean, median, mode, and make a histogram of a 99 value array. How ever my sorting function is not sorting the array at all how can I fix this.

#include <iostream>
#include <fstream>
#include <cstdlib>
#include <math.h>
#include <cctype>

[Code].....

View 8 Replies View Related

C :: How To Make Function Which Gives Back Two Numerical Values

Nov 3, 2014

How make function which gives back two numerical values. I think needs using structure. now i try found my c book.

View 3 Replies View Related

C++ :: Floating Point Numbers / Numerical Analysis

Oct 30, 2013

I have the problem of trying to find the smallest natural number that makes two consecutive terms in single precision floating point notation in the riemann zeta function equal. So basically the riemann function of 2 is given by:

sum of 1/(k^2) from k=1 until infinity, so : 1/(1^2) + 1/(2^2) + 1/(3^2) + ...... until infinity.

Now the question asks to stop at the smallest natural number n, at which the sum 1/1^2 + 1/2^2 + ......+ 1/(n^2) is equal to the sum 1/1^2 + 1/2^2 + ..... + 1/((n+1)^2) in single precision floating point notation.

Now well the obvious way to look for n would be on this way:

float i = 1.0;
float n = 1/(i);
float n1 = 1/(i+1.0);
while ( n != n1){
i += 1.0;
n = 1/i;
n1 = 1/(i+1.0);}

But first of all this is obviously completely inefficient and I dont think it will yield a valid answer for any float variable, i.e. I dont think the sum until 1/n^2 and 1/(n+1)^2 will ever differ. I tried it out with the largest possible value of a variable of type float and the values were still seen as unequal in C++. How to do this? Will C++ find a value for n for which the condition holds? Is the compiler or my hardware important for this, i.e. would I get different results on a different pc?

View 2 Replies View Related

C/C++ :: Infinite Loop If Non-numerical Character Entered

Jul 28, 2014

it will produce the answer above..when user enter a nonnumerical character it will force the user to reenter again

do {
cout<<"Min of the secret number : ";
cin>>min;
}while(cin>>min);
cout<<"Max of the secret number : ";
cin>>max;

this is my coding but it will auto jump out when i enter non-numeric character

View 7 Replies View Related

C++ :: Implementing Template Operator - Numerical Array

Jun 19, 2012

I what to implement to my Template operator * . There is <Template> Array which purpose is container like vector for classes. There is class Point, each object of contain two coordinate x and y.

So,
1. I wanna fill Array with objects from Point class
2. Multiply each objects from this vector to a factor
3. And print all this bunch of objects ()...

Compile error :
1>------ Build started: Project: HP_4.2b_Ex2, Configuration: Release Win32 ------
1> main.cpp
1>main.cpp(21): error C2440: 'initializing' : cannot convert from 'Point' to 'Array<Type>'

[Code] ....

And pop -up helper tell that : Error: no suitable user defined conversion from "Point " to Array<Point> exist

Code:
//array.h
#ifndef Array_H
#define Array_H
template <class Type> //Remove the "=double" default parameter.
class Array {
protected:
int m_size;
Type* m_data; //m_data should be a pointer, since you want to allocate data to it

[Code] ....

View 6 Replies View Related

C++ :: How To Create A Large Matrix To Be Solved Using Numerical Methods

Jun 24, 2013

I am having a problem on how will I create a large matrix to be solved using numerical methods. Say I have a 500 x 500 matrix and want to find these 500 equations. How will I do it? To be exact, here is a sample problem

| -2 1 . . . . . . . || x1 | |h^2|
| 1 -2 1 . . . . . . || x2 | |h^2|
| 0 1 -2 1 . . . . . || . | | . |
| 0 0 1 -2 1 . . . . || . | = | . |
| . . . . . . . . . 1 || . | | . |
| . . . . . . . . 1 -2||x500| |h^2|

Where h = 1/(n + 1)

Solutions on finding would be gauss elimination, Successive overrelaxation, Jacobi Iteration, biconjugate gradient method and Thomas algorithm. I want to compare the accuracy, with tolerance of 10^-6

View 2 Replies View Related

C++ :: Number Of Characters / Operators / Uppercase Letters And Numerical Digits

May 5, 2014

I have to code a simple program who determining the number of Characters (A character could be any alphabets, digits, punctuation marks, or special , Operators ( Operators are those symbols that are used in mathematica expression, such as,'+', '*', '/', '-', and so on.), Uppercase letters (Uppercase characters are those from A..Z) and Numerical digits ( A digit is any of the Hindu-Arabic numerals from 0..9). Why the output is wrong!

#include <iostream>
#include <string>
#include <fstream>
#include <cstdlib>
#include <iomanip>
using namespace std ;
int main() {
char text;

[Code] .....

This is my input file This is a possible factorial function in a programming language called LISP

(defun factorial (n)
(if (< n 2)
1
(* n (factorial (1- n)))))

This is my output:

The number of characters = 113
The number of operators = 3
The number of numerical digits = 3
Uppercase letters = 5

I think that "characters" is wrong, but I do not know why !

View 4 Replies View Related

C :: Program To Accept Only Numerical Values And Gives Error If Character Or Symbol Entered

Nov 11, 2013

How can i make my program to accept only numerical values and gives a error notice if a character or a symbol is entered???

View 4 Replies View Related

Visual C++ :: Writing A Function That Sort Elements Of Array In Numerical Order?

Oct 17, 2014

I have to write a function called sortMe that sorts the elements of an array in numerical order from highest to lowest values (descending order) or vice versa (ascending order).

The assignment asks to: NOT re-arrange elements in the array; instead, it uses a second array, an array of indexes for the elements in the original array and then sortMe sorts the second array based on the values in the original array. A sorted version of the original array can then be produced with these sorted indexes.

Header of the function sortMe must be as shown below:

void sortMe(int array[],int sortedIndexes [], int size, char mode)

When mode is 'a', the function sorts the array in the ascending order, and when mode is 'd', the function sorts it in the descending order.

Declare and initialize the array array.

Declare the array sortedIndexes but do not initialize it. You are going to play with the array sortedIndexes in the function sortMe.

EXAMPLE:

int array[5]={3, 5,-1,10,0};
int sortedIndexes[5];
sortMe(array,sortedIndexes, 5, 'a');

After the function call, the elements of the array sortedIndexes should be: 2,4,0,1,3.

notice that the function does not e-arrange the elements in the array.

Code:
#include <iostream>
using namespace std;
void sortMe(int[], int, char);
void main() {
int arr[6] = { 14, -5, 5, 0, 22, -99 };

[code]...

how to use the other array.

View 5 Replies View Related

C++ :: Shared Library Vs Static Library?

Jan 17, 2014

I've been reading about libraries; How to make them, how to use them, the different types of libraries, etc..

When using a shared library, does the program require that library to be installed on the computer after the program has been compiled into an .exe?

Ie.. if somebody downloaded a "Helloworld.exe" that I had compiled on my computer using a shared library (that wasn't part of a standard operating system), would they also need that shared library on their computer for the program to run without errors?

and for Static Libraries, when I compile a program using a static library, does it include in the final binary only the functions of the library that are actually used, or does the compiler add in the entire library?

View 8 Replies View Related

C++ :: Grading Scale - Determine Letter Grade Based On Numerical Grade

Apr 23, 2014

I have to accept the numerical grade and determine the letter grade that the user will receive. I have to use a grading table to determine the letter grade based on the numerical grade. The Letter Grade table is

A 90-100
B 80-89
C 70-79
D 60-69
F 59 and below

Here is the code

//preprocessor directives
#include <iostream>
#include <string>

//namespace statement
using namespace std;

//function prototypes
void getData (string& course, string& first, string& last, int& grade);

[Code] ......

As you can see, I am currently stuck on the determineGrade one

View 1 Replies View Related

C :: How To Install GMP Library

Feb 19, 2013

How do you install the gmp library.How do you use it?

View 11 Replies View Related

C++ :: GMP Library Memory

May 11, 2013

I'm trying out the gmp library by building a simple pi calculation program (original, I know!). On a million digits of Pi I've debugged the program and seem to have about a megabyte too much of memory at the end of the program (I start with around 250k before any allocation begins and end at around 1200).

int main(int argc, char *argv[]) {
//set a//
int digitsofpi =1000000;
mpf_set_default_prec(log2(10) *digitsofpi );

mpf_t a;
mpf_init (a);
mpf_set_ui (a,1);

[code].....

View 2 Replies View Related

C++ :: How To Set Bullet Library To GCC

Jul 11, 2013

I would like to set the bullet library to GCC. I downloaded source code of bullet but i don't know how to set that.

View 6 Replies View Related

C++ :: Using A Library Function?

May 9, 2013

I have been trying to find a way around the following:

I am using a library functor to solve the root of a non linear equation. It passes two doubles and the name of a function that contains the equation to be solved.

Its xtor and operator are

RootFind(double tL,double tR,double (*fn)(double t));

void operator()(double tL,doubleR,double (*fn)(double t));

I want to be able to send another variable to function fn; I don't know what the value of the variable will be ahead of time.

How do I get the library functor to take an extra variable in the function passed?

View 1 Replies View Related

C++ :: How To Use Library Opensteer

Nov 5, 2014

I use the library opensteer, but I do not know where you should start.

Opensteer is a library written in C ++. My problem is figuring out whether to create a blank project in visual studio and import the library or directly import the library.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved