Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I'm doing aproximation of derivative called five-point stencil. For every value of x, in interval [a,b], in step of 0.1 i need to calculate derivative.
2. Relevant commands, code, scripts, algorithms:
The equation is like this:
I want to calculate every of theese, so first, sec, third.... expression and then at the end calculate derivative.
3. The attempts at a solution (include all code and scripts):
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
I'm studying physics in Rijeka, University of Rijeka, Croatia, but it's not for exact course, I'm doing it because I want to learn...
hi,
I have made a small C program that make use of malloc and free for processing bitmap images. when i try to run the program, I am getting a error something like
*** glibc detected *** free(): invalid next size (normal): 0x0000000000503e70 ***
I am not sure of which free() is causing this... (1 Reply)
when i try to use the class i wrote, i either get this:
*** glibc detected *** double free or corruption: 0x40236ff4 ***
and the proccess exits with an error code of 0;
or it segfaults. could someone look at my header file (with imp.) to give me some insight as to why its not working?
... (19 Replies)
I am using a structure defined as follows
struct gene_square
{
double *x;
double *y;
};I have class, with a member function which is a pointer of this type:
gene_square* m_Genes;I am allocating memory in the constructors like this:
m_Genes = new gene_square;
for (ii=0;... (1 Reply)
there seems not to be error in this segment. In some computers, it can work well. But in others, it will give a failure.
why it ocurrs and how to deal with it?
in a function:
if( *ver == NULL ) {
*ver = (vertex *) malloc(sizeof(vertex)); //this line
... (17 Replies)
Here is a simple program to find the vowels in the string.
Output is fine.
But I'm getting GLIBC detected as shown below : :eek:
*** glibc detected *** ./VOWELS: free(): invalid pointer: 0x08b82013 ***
======= Backtrace: =========
/lib/libc.so.6
/lib/libc.so.6(cfree+0x59)
./VOWELS... (5 Replies)
*** glibc detected *** ./a.out: malloc(): memory corruption (fast):
Posted A minute ago
M trying to make multiway tree and dont know what happend when this part of code get executed:
01void ins(NODE *ptr)
02{
03 //working
04 if(ptr!=NULL)
05 {
06 SNODE *var=NULL;
07 var=(SNODE... (3 Replies)
I have to debug a function getopt_long in glibc-2.11.3-17.31.1.
For that how can I download and install its corresponding glibc-debug on SLES 11? (8 Replies)
I am facing a problem of memory corruption. The loop runs for the first time but does not go through the second time. What could be the problem?
for(int z=0;z<2;z++)
{
fp=fopen("poly.dat","r");
/*do something which reads this file into a 2D array*/
fclose(fp);
... (10 Replies)
Currently I test a shared library vendor provided in linux , the following is the simple source :
#include <iostream>
using namespace std;
extern int test1();
extern int test2();
int main()
{
cout << "hello world" << endl ;
return 0 ;
cout << "Test 1" << endl;
... (6 Replies)
Discussion started by: barfatchen
6 Replies
LEARN ABOUT SUSE
glstencilfunc
GLSTENCILFUNC(3G)GLSTENCILFUNC(3G)NAME
glStencilFunc - set function and reference value for stencil testing
C SPECIFICATION
void glStencilFunc( GLenum func,
GLint ref,
GLuint mask )
PARAMETERS
func Specifies the test function. Eight tokens are valid: GL_NEVER, GL_LESS, GL_LEQUAL, GL_GREATER, GL_GEQUAL, GL_EQUAL, GL_NOTEQUAL, and
GL_ALWAYS. The initial value is GL_ALWAYS.
ref Specifies the reference value for the stencil test. ref is clamped to the range [0,2n-1], where n is the number of bitplanes in the
stencil buffer. The initial value is 0.
mask Specifies a mask that is ANDed with both the reference value and the stored stencil value when the test is done. The initial value is
all 1's.
DESCRIPTION
Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis. You draw into the stencil planes using GL drawing
primitives, then render geometry and images, using the stencil planes to mask out portions of the screen. Stenciling is typically used in
multipass rendering algorithms to achieve special effects, such as decals, outlining, and constructive solid geometry rendering.
The stencil test conditionally eliminates a pixel based on the outcome of a comparison between the reference value and the value in the
stencil buffer. To enable and disable the test, call glEnable and glDisable with argument GL_STENCIL_TEST. To specify actions based on
the outcome of the stencil test, call glStencilOp.
func is a symbolic constant that determines the stencil comparison function. It accepts one of eight values, shown in the following list.
ref is an integer reference value that is used in the stencil comparison. It is clamped to the range [0,2n-1], where n is the number of
bitplanes in the stencil buffer. mask is bitwise ANDed with both the reference value and the stored stencil value, with the ANDed values
participating in the comparison.
If stencil represents the value stored in the corresponding stencil buffer location, the following list shows the effect of each comparison
function that can be specified by func. Only if the comparison succeeds is the pixel passed through to the next stage in the rasterization
process (see glStencilOp). All tests treat stencil values as unsigned integers in the range [0,2n-1], where n is the number of bitplanes
in the stencil buffer.
The following values are accepted by func:
GL_NEVER Always fails.
GL_LESS Passes if ( ref & mask ) < ( stencil & mask ).
GL_LEQUAL Passes if ( ref & mask ) <= ( stencil & mask ).
GL_GREATER Passes if ( ref & mask ) > ( stencil & mask ).
GL_GEQUAL Passes if ( ref & mask ) >= ( stencil & mask ).
GL_EQUAL Passes if ( ref & mask ) = ( stencil & mask ).
GL_NOTEQUAL Passes if ( ref & mask ) != ( stencil & mask ).
GL_ALWAYS Always passes.
NOTES
Initially, the stencil test is disabled. If there is no stencil buffer, no stencil modification can occur and it is as if the stencil test
always passes.
ERRORS
GL_INVALID_ENUM is generated if func is not one of the eight accepted values.
GL_INVALID_OPERATION is generated if glStencilFunc is executed between the execution of glBegin and the corresponding execution of glEnd.
ASSOCIATED GETS
glGet with argument GL_STENCIL_FUNC
glGet with argument GL_STENCIL_VALUE_MASK
glGet with argument GL_STENCIL_REF
glGet with argument GL_STENCIL_BITS
glIsEnabled with argument GL_STENCIL_TEST
SEE ALSO glAlphaFunc(3G), glBlendFunc(3G), glDepthFunc(3G), glEnable(3G), glIsEnabled(3G), glLogicOp(3G), glStencilOp(3G)GLSTENCILFUNC(3G)