Skip to content

Instantly share code, notes, and snippets.

/* Fills solution into x. Warning: will modify c and d! */
// this is the old signature:
//void TridiagonalSolve(const double *a, const double *b, double *c, double *d, double *x, unsigned int n){
// this is the new signature signature:
// - we don't use arrays, instead we use the matrix and vector objects introduced in earlier pechstein exercises
// - the "unsigned int n", which denotes the size of the matrix/vectors, can be dropped because it is
// stored inside the matrix/vector objects and is redundant information.
void TridiagonalSolve(const Matrix &Kh, const Vector &fh, const Vector &uh){
int i;
#include <iostream>
#include "include/TriMatrix.h"
#include "include/Vector.h"
using namespace std;
// Implements the Dirichlet boundary condition to garantuee
// unique weak solution of boundary value problem
//
// $u(x_i)=g_D(x_i)$
#include <iostream>
#include "../include/Stiffness_main.h"
#include "../include/Mesh.h"
#include "../include/TriMatrix.h"
#include "../include/Preconditioner.h"
using namespace std;
//====================================
// f(x):=8
IntBuffer getsetBuffer = BufferUtil.newIntBuffer(1);
// int getset[] = new int[1];
public int get(int x, int y) {
gl.glReadPixels(x, y, 1, 1, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, getsetBuffer);
// gl.glReadPixels(x, y, 1, 1, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, getset, 0);
int getset = getsetBuffer.get(0);
if (BIG_ENDIAN) {
return 0xff000000 | ((getset >> 8) & 0x00ffffff);
for (int bild = 0; bild < anzahl_bilder; ++bild) {
for (int pixel=0; pixel < wid*hig; ++pixel) {// adding all images to one "ultra bright" image
allr[pixel] = alle_bilder[0][pixel];
allg[pixel] = alle_bilder[1][pixel];
allb[pixel] = alle_bilder[2][pixel];
}
}
import processing.opengl.*;
import fullscreen.*;
SoftFullScreen fs;
PFont font;
boolean reloadFont = false;
void setup(){
size( screen.width, screen.height, OPENGL );
frameRate(2000);
color currentcolor;
RectButton rect1, rect2, rect3, rect4, rect5, rect6, rect7;
boolean locked = false;
Button focusElement = null;
Button focusOrder[];
// put your PRICE_START, etc. constants at the very top of your program
int findMaxValue( int start, int end ){
int maxValue = 0;
for( int i = 0; i < lines.length; i++ ){
if( lines[i].length() >= end ){
maxValue = max( maxValue, int( lines[i].substring( start, end ) ) );
}
}
void printMaxValue( int start, int end ){
int maxValue = 0;
println( "Considering " + lines.length + " lines: (chars " + start + " to " + end + ")" );
for( int i = 0; i < lines.length; i++ ){
if( lines[i].length() >= end ){
println( i + ": extracted " + lines[i].substring( start, end ) + ", which parses as " + int( lines[i].substring( start, end ) ) );
maxValue = max( maxValue, int( lines[i].substring( start, end ) ) );
}
if( keyCode == ENTER ){
if( focusElement == rect2 ) ....
if( focusElement == rect4 ) ...
// afaik the "name" button is rect 1, in which case we just loop through all lines and print the names
if( focusElement == rect1 ){
for( int i =0; i < lines.length; i++ ){
println( lines[i].substring( NAME_START, NAME_END ) );
}
}