OpenLLM-France/wikimedia huggingface dataset:
# OpenClinica User Manual/RemovingSubjects
## Removing Subjects
### Remove and auto-removed

In the course of your trial, chances are that you will have to "remove" a subject, or trial-participant. You can do this by using the menu-option Tasks-Administration-Subjects. In the list with all subjects you scroll to your Subject or you filter the list to get the right person. Then you click on the X-icon and the status of the person will change from "available" to "removed". So far so good. But you may be surprised to see the Subject still in the Subject-matrix and with status "auto-removed".
First of all the difference between "removed" and "auto-removed". "Subject" is one level higher than "Study Subject", so if you remove a subject in the way described above, you remove the top-level and the sub-levels are "auto-removed". To see the same difference: Use the Subject-matrix and click on the magnifying glass-icon. Here you see option "Study Subject Record" (top) and "Global Subject Record" (bottom).

### Cleaning your subject matrix

It is expected behaviour that after you "remove" a Study Subject or even after you "remove" a Subject, this person still shows up in the subject matrix, due to regulations. If you do not want your list to get cluttered, consider creating an extra site for your study called "RemovedSubjects" or another appropriate name. You can assign Subjects to this site after "removing" them. This way they will not show up in the regular Subject-matrix. Remember that this will only work if you specify assign users to one or more Study-sites, as opposed to assigning them to the whole Study.
# Numerical Methods Qualification Exam Problems and Solutions (University of Maryland)/August 2002
## Problem 2

* Suppose there is a quadrature formula
* $\int _{a}^{b}f(x)dx\approx w_{a}f(a)+w_{b}f(b)+\sum _{j=1}^{n}w_{j}f(x_{j})\!\,$
* which produces the exact integral whenever $f\!\,$ is a polynomial of degree $2n+1\!\,$. Here the nodes $\{x_{j}\}_{j=1}^{n}\!\,$ are all distinct. Prove that the nodes lies in the open interval $(a,b)\!\,$ and the weights $w_{a},w_{b}\!\,$ and $\{w_{j}\}_{j=1}^{n}\!\,$ are positive.

## Solution 2
### All nodes lies in (a,b)

Let $\{x_{i}\}_{i=1}^{l}\!\,$ be the nodes that lie in the interval $(a,b)\!\,$.
Let $q_{l}(x)=\prod _{i=1}^{l}(x-x_{i})\!\,$ which is a polynomial of degree $l\!\,$.
Let $p_{n}(x)=\prod _{i=1}^{n}(x-x_{i})=q_{l}(x)\prod _{i=1}^{n-l}(x-x_{i})\!\,$ which is a polynomial of degree $n>l\!\,$.
Then
$\langle p_{n},q_{l}\rangle =\int _{a}^{b}q_{l}^{2}(x)\underbrace {\prod _{i=1}^{n-l}(x-x_{i})} _{r(x)}\neq 0\!\,$
since $r(x)\!\,$ is of one sign in the interval $(a,b)\!\,$ since for $i=1,2,\ldots n-l\!\,$, $x_{i}\not \in (a,b).\!\,$
This implies $q_{l}\!\,$ is of degree $n\!\,$ since otherwise
$\langle p_{n},q_{l}\rangle =0\!\,$
from the orthogonality of $p_{n}\!\,$.
# Numerical Methods Qualification Exam Problems and Solutions (University of Maryland)/August 2003
## Problem 3

* Let $A,B\in R^{n\times n}\!\,$ be symmetric and positive definite matrices, and let $b\in R^{n}\!\,$. Consider the quadratic function $Q(x)={\frac {1}{2}}x^{T}Ax-x^{T}b\!\,$ for $x\in R^{n}\!\,$ and a descent method to approximate the solution of $Ax=b\!\,$:
* $x_{k+1}=x_{k}+\alpha _{k}d_{k}\!\,$

## Problem 3a

* Define the concept of steepest descent $d_{k}\!\,$ and show how to compute the optimal stepsize $\alpha _{k}\!\,$

### Descent Direction

$\nabla Q(x_{k})\cdot d_{k}<0\!\,$

### Optimal step size

Choose $\alpha _{k}\!\,$ such that $Q(x_{k}+\alpha _{k}d_{k})\!\,$ is minimized i.e.
$\alpha _{k}:\min _{\alpha _{k}}Q(x_{k}+\alpha _{k}d_{k})\!\,$
$Q(x_{k}+\alpha _{k}d_{k})=\langle x_{k}+\alpha _{k}d_{k},Ax_{k}+\alpha _{k}Ad_{k}\rangle -\langle x_{k}+\alpha _{k}d_{k},b\rangle \!\,$
${\frac {d}{d\alpha }}Q(x_{k}+\alpha _{k}d_{k})=\langle Ad_{k},x_{k}\rangle +\alpha _{k}\langle Ad_{k},d_{k}\rangle -\langle d_{k},b\rangle \!\,$
Setting the above expression equal to zero gives the optimal $\alpha _{k}\!\,$:
$\alpha _{k}={\frac {\langle d_{k},b-Ax_{k}\rangle }{\langle Ad_{k},d_{k}\rangle }}\!\,$
Note that since $A\!\,$ is symmetric
$\langle d_{k},Ax_{k}\rangle =\langle Ad_{k},x_{k}\rangle \!\,$

## Problem 3b

* Formulate the steepest descent (or gradient method) method and write a pseudocode which implements it.

## Solution 3b

Note that $d_{k}=-\nabla Q(x_{k})=b-Ax_{k}=r_{k}\!\,$. Then the minimal $\alpha _{k}\!\,$ is given by ${\frac {\langle r_{k},r_{k}\rangle }{\langle r_{k},r_{k}\rangle _{A}}}\!\,$
Given $x_{0}\in R^{n}\!\,$

## Problem 3c

* Let $B^{-1}\!\,$ be a preconditioner of $A\!\,$. Show how to modify the steepest descent method to work for $B^{-1}Ax=B^{-1}b\!\,$ and write a pseudocode. Note that $B^{-1}A\!\,$ may not be symmetric. (Hint: proceed as with the conjugate gradient method).

## Solution 3

Since $B\!\,$ is symmetric, positive definite, $B=E^{T}E\!\,$ where $E\!\,$ is upper triangular (Cholesky Factorization).
Then $B^{-1}=E^{-1}E^{-T}\!\,$
Hence,
${\begin{aligned}B^{-1}Ax&=B^{-1}b\\E^{-1}E^{-T}Ax&=E^{-1}E^{-T}b\\E^{-T}Ax&=E^{-T}b\\\underbrace {E^{-T}AE^{-1}} _{\tilde {A}}\underbrace {Ex} _{\tilde {x}}&=\underbrace {E^{-T}b} _{\tilde {b}}\end{aligned}}\!\,$
${\tilde {A}}\!\,$ is symmetric:
$(E^{-T}AE^{-1})^{T}=E^{-T}AE^{-1}\!\,$ since $A\!\,$ symmetric
${\tilde {A}}\!\,$ is positive definite:
$x^{T}E^{-T}AE^{-1}x=(E^{-1}x)^{T}A(E^{-1}x)>0\!\,$ since $A\!\,$ positive definite

### Pseudocode

Given $x_{0}\in R^{n}\!\,$
# OpenGL Programming/Advanced/Optimization

Optimizing OpenGL code is an important step in achieving high-performance graphics rendering. Here are some tips for optimizing OpenGL code:
* Minimize state changes: One of the most important optimizations is to minimize the number of state changes that occur during rendering. This includes things like changing the current texture, switching between shaders, or modifying blending settings. By minimizing state changes, you can reduce the overhead associated with these operations and improve overall rendering performance.
* Batch draw calls: Another optimization technique is to batch draw calls together. This involves grouping objects or primitives that share similar rendering characteristics, such as shader programs or textures. By batching draw calls, you can reduce the overhead associated with setting up and tearing down OpenGL state.
* Use vertex buffer objects: Vertex buffer objects (VBOs) are a way to store vertex data on the graphics card's memory. This can improve performance by reducing the amount of data that needs to be transferred between the CPU and GPU. By using VBOs, you can reduce the overhead associated with sending data to the GPU and improve rendering performance.
* Use frustum culling: Frustum culling is a technique for optimizing rendering by only drawing objects that are within the camera's view frustum. This can improve performance by reducing the number of objects that need to be drawn.
* Use mipmapping: Mipmapping is a technique for creating lower-resolution versions of textures that are used when the texture is viewed at a distance. By using mipmapping, you can improve rendering performance by reducing the amount of texture data that needs to be loaded and processed.
These are just a few tips for optimizing OpenGL code. Ultimately, the key to achieving high-performance graphics rendering is to carefully analyze your code and identify areas where performance can be improved. By using profiling tools and monitoring performance metrics, you can identify bottlenecks and implement optimizations that will improve the speed and efficiency of your OpenGL code.
# OpenGL Programming/Basics/3DObjects

OpenGL is a powerful graphics library that allows you to create 3D graphics in C++. In this tutorial, we will be discussing how to draw a simple 3D object in OpenGL and C++. We will be using the GLUT library for this tutorial, which provides a set of tools for creating simple OpenGL applications.

## Prerequisites

Before we get started, make sure you have the following software installed:
* An IDE such as Visual Studio or Code::Blocks
* The GLUT library
* OpenGL headers and libraries

## Setting Up

To get started, create a new C++ project in your IDE and include the necessary OpenGL and GLUT headers. Here's an example:
Next, we'll define some variables for our 3D object:
We'll use these variables to manipulate the position and orientation of our object.

## Drawing a Simple 3D Object

Let's start by drawing a simple cube. We'll use the glutSolidCube function to create the cube, and glTranslatef and glRotatef to position and orient it.
The glClear function clears the color and depth buffers, and glMatrixMode and glLoadIdentity set the current matrix mode and load the identity matrix, respectively. The glTranslatef and glRotatef functions are used to position and orient the cube, and the glutSolidCube function is used to draw the cube. Finally, glutSwapBuffers is used to swap the front and back buffers.
We'll also need to set up the window and OpenGL context in the main function:
The glutInit function initializes GLUT, and glutInitDisplayMode sets up the display mode. glutInitWindowSize sets the window size, and glutCreateWindow creates the window. glEnable(GL_DEPTH_TEST) enables depth testing. Finally, glutDisplayFunc and glutIdleFunc set the display and idle functions, respectively, and glutMainLoop enters the GLUT event processing loop.

## Conclusion

In this tutorial, we learned how to draw a simple 3D object in OpenGL and C++. We used the GLUT library to set up the window and OpenGL context, and we used glTranslatef and glRotatef to position and orient the cube. We also discussed how to enable depth testing to ensure that objects are rendered correctly based
# OpenGL Programming/Advanced/GLSL
## Variables

Variables can be passed into GLSL like position and color, but other custom variables are available. Those that change within a glBegin/glEnd pair are called "attributes"; those that are not are called "uniform" . After creating a GLSL program, one gets handles to the variables using
or
The result of this call is then used to set the value of the corresponding variable. Depending on the number of degrees of freedom, one uses
or alternately,
For example, in GLSL you might have
then in C/C++ you could say:

## External links

* Lighthouse 3D on GLSL
# OpenGL Programming/Anti-Aliasing

- DRAFT -
Concept keywords:
* (Spatial) Anti-aliasing
* MSAA (MultiSample Anti-Aliasing)
** Provided by OpenGL
** According to phoronix.com, MSAA is still in progress in Mesa.
** Full GLUT example available at OpenGL wiki, using GL_MULTISAMPLE/GLUT_MULTISAMPLE (not producing results with Mesa 8).
* Supersampling or FSAA (Full-Scene/Full-Screen Anti-Aliasing)
** using the accumulation buffer: cf. OpenGL Programming/Supersampling
Shader-based (with acronyms feast!):
* Fast Approximate Anti-Aliasing (FXAA): based on Intel's MLAA
* Normal Filter AA (NFAA): using edge detection
* Practical Morphological Anti-Aliasing (PMAA) and Enhanced Subpixel Morphological Antialiasing (SMAA):
** http://www.iryoku.com/mlaa/
** http://www.iryoku.com/smaa/
- Recent stats
< OpenGL Programming
# OpenGL Programming/Basics/Color
## Color
### Using monitors RGB to define a single color

There are many ways to specify a color in computer graphics, but one of the simplest and most widely used methods of describing a color is the RGB color model. RGB stands for the colors red, green and blue: the additive primary colors. Each of these colors is given a value, in OpenGL usually a value between 0 and 1. 1 means as much of that color as possible, and 0 means none of that color. We can mix these three colors together to give us a complete range of colors, as shown to on the left.
For instance, pure red is represented as (1, 0, 0) and full blue is (0, 0, 1). White is the combination of all three, denoted (1, 1, 1), while black is the absence of all three, (0, 0, 0). Yellow is the combination of red and green, as in (1, 1, 0). Orange is yellow with slightly less green, represented as (1, 0.5, 0).
For more information on RGB, see the Wikipedia article.

### Using glColor3f

glColor3f takes 3 arguments: the red, green and blue components of the color you want. After you use glColor3f, everything you draw will be in that color. For example, consider this display function:
This outputs a rectangle/quad in an attractive purple color.
Play with glColor3f, passing different arguments in. See if you can make dark green, light gray or teal.

### Giving Individual Vertices Different Colors

glColor3f can be called in between glBegin and glEnd. When it is used this way, it can be used to give each vertex its own color. The resulting rectangle is then shaded with an attractive color gradient, as shown on the right.
# OpenGL Programming/About

This book is aimed at beginners who are discovering OpenGL!
It will assume knowledge of basic C and C++. (If you're rusty on these subjects, consider reading a C++ book first.) If you know nothing about 3D graphics, we'll try to familiarize you along the way. In addition, certain parts of the book will require mathematics. We'll provide basic explanations as much as possible, as well as point you to the appropriate Wikipedia subject pages.
OpenGL 2 is a bit hard at the beginning, because of all the new shaders and buffer object concepts, so we took every possibly measure to start *very* basic, but functional, and add features progressively. Often, we wrote the tutorials as we learned OpenGL, so we believe we saw by ourselves where beginners needed explanations first. As a consequence, there may be better ways than what we documented, in which case feel free to contribute.
We start straight with shaders, and replace all legacy 1.x functions with 2.x replacements (we also have a section on upgrade tips). We stick to OpenGL 2.1 core profile / OpenGL ES 2, which is now widely available in mobile, desktop and web (WebGL) platforms. We also have a section on non-gaming topics such as Scientific visualization.
Since the tutorials are pretty new, this wikibook's contributors keep improving them - if you feel some areas are still obscure, feel free to let a comment, or even contribute your own explanations :)
This wikibook is released under the Creative Commons CC-BY-SA and the GNU Free Documentation License, and the code samples are placed in the public domain, and available from the code repository: https://gitorious.org/wikibooks-opengl
- Recent stats
< OpenGL Programming
# OpenGL Programming/Advanced/Shadows

Drawing shadows in OpenGL can be a challenging task, but there are several techniques that can be used to achieve convincing results. Here are a few common techniques for drawing shadows in OpenGL:
* Shadow mapping: Shadow mapping is a popular technique for rendering shadows in real-time 3D graphics. It involves rendering the scene from the perspective of the light source and storing the depth values in a texture. The texture is then used to determine whether a pixel is in shadow or not when the scene is rendered from the camera's perspective.
* Shadow volumes: Shadow volumes are another technique for rendering shadows that works by creating a volume that surrounds an object and intersects with other objects in the scene. This volume is then used to determine whether a pixel is in shadow or not.
* Shadow masks: Shadow masks are a technique for rendering soft shadows in OpenGL. They work by rendering a black and white mask that represents the shape of the shadow, and then using this mask to modulate the brightness of the objects in the scene.
* Projected textures: Projected textures can be used to simulate the appearance of shadows by projecting a texture that represents the shadow onto the objects in the scene. This technique can be used to create soft shadows or to simulate the appearance of shadows cast by objects that are not in the scene.
Each of these techniques has its own strengths and weaknesses, and the best approach will depend on the specific requirements of your project. By experimenting with these techniques and adapting them to your needs, you can create convincing and visually appealing shadows in your OpenGL applications.
Here's an example of how to implement shadow mapping in OpenGL using shaders and framebuffers:
First, set up the framebuffers and depth texture:
Next, create the shadow map shader program:
Then, render the scene from the light's perspective to the depth texture:
Finally, render the scene from the camera's perspective, using the depth texture to determine whether a pixel is in shadow:
This is just a basic example, and there are many ways to optimize and improve this code. However, it should give you an idea of how to implement shadow mapping in OpenGL using shaders and framebuffers.
# Linear Algebra/Row and column spaces

Having gone over vector spaces, we now combine the ideas of bases and dimension with the vector spaces, and the ideas of linear dependence and rank applied earlier. We will apply these important ideas to the general solution of m linear equations of n variables.

## Definitions

Suppose we have an a field F and an m×n matrix of elements of F, and let r be the rank of that matrix.
Consider the columns or rows of the matrix are elements of a vector space where addition and scalar multiplication were defined before. One can easily check that they form a vector space.
Let M be a minor of the matrix F with order r. This minor is called the basis minor, and the columns and rows of this minor are called the basis columns and basis rows. The column space and row space of a matrix are respectively the vector spaces spanned by the columns and rows of the matrix.

## Theorem

The dimension of both the basis and column spaces of a matrix are both equal to r, the rank of the matrix, and the basis columns (or rows) form a basis for the column (or row) space.

### Proof

Let 𝐴 be a 𝑚×𝑛 matrix with rank 𝑟. Consider a matrix 𝐿 𝑚×𝑟 which is formed by the 𝑟 columns of 𝐴 forming the bases (vectors). By construction of 𝐿, each column of 𝐴 can be written as a linear combination of the columns of 𝐿 i.e. there exist a matrix 𝑍 𝑟×𝑛 such that 𝐴=𝐿𝑍. This means that each row of 𝐴 can be written as a linear combination of the 𝑟 rows of 𝑍 i.e. the row space of 𝐴is spanned by the rows of 𝑍. That is, row rank of 𝐴 is bounded above by 𝑟. Also, 𝐴^𝑇=𝑍^𝑇𝐿^𝑇. Clearly, the range of 𝑍^𝑇𝐿^𝑇 is contained in the range of 𝑍^𝑇. So, the rank of 𝐴^𝑇 is at most the rank of 𝐴. This argument holds for any matrix. Using the above argument and a similar argument starting with 𝐴𝑇, we conclude that transposition does not change the rank of the matrix.

### Corollaries

* Any n columns are linearly dependent when n>r.
* The columns (or rows) of a matrix are linearly dependent when the number of columns (or rows) is greater than the rank, and are linearly independent when the number of columns (or rows) is equal to the rank.
* The maximum number of linearly independent rows equals the maximum number of linearly independent columns.
# Linear Algebra/Solving Linear Systems

Systems of linear equations are common in science and mathematics. These two examples from high school science (O'Nan 1990) give a sense of how they arise.
The first example is from Physics. Suppose that we are given three objects, one with a mass known to be 2 kg, and are asked to find the unknown masses. Suppose further that experimentation with a meter stick produces two balances (one of which is depicted below).
Since the sum of magnitudes of the torques of the clockwise forces equal those of the counter clockwise forces (the torque of an object rotating about a fixed origin is the cross product of the force on it and its position vector relative to the origin; gravitational acceleration is uniform we can divide both sides by it). The two balances give this system of two equations.
    ${\begin{array}{rl}40h+15c&=100\\25c&=50+50h\end{array}}$
The second example of a linear system is from Chemistry. We can mix, under controlled conditions, toluene ${\hbox{C}}_{7}{\hbox{H}}_{8}$ and nitric acid ${\hbox{H}}{\hbox{N}}{\hbox{O}}_{3}$ to produce trinitrotoluene ${\hbox{C}}_{7}{\hbox{H}}_{5}{\hbox{O}}_{6}{\hbox{N}}_{3}$ along with the byproduct water (conditions have to be controlled very well, indeed— trinitrotoluene is better known as TNT). In what proportion should those components be mixed? The number of atoms of each element present before the reaction.
    $x\,{\rm {C}}_{7}{\rm {H}}_{8}\ +\ y\,{\rm {H}}{\rm {N}}{\rm {O}}_{3}\quad \longrightarrow \quad z\,{\rm {C}}_{7}{\rm {H}}_{5}{\rm {O}}_{6}{\rm {N}}_{3}\ +\ w\,{\rm {H}}_{2}{\rm {O}}$
must equal the number present afterward. Applying that principle to the elements C, H, N, and O in turn gives this system.
    ${\begin{array}{rl}7x&=7z\\8x+1y&=5z+2w\\1y&=3z\\3y&=6z+1w\end{array}}$
To finish each of these examples requires solving a system of equations. In each, the equations involve only the first power of the variables. This chapter shows how to solve any such system.

## References

* O'Nan, Micheal (1990), Linear Algebra (3rd ed.), Harcourt College Pub.
# Linear Algebra/Span of a set
## Definition

Let V be a vector space over a field F. Choose n vectors x$_1$, x$_2$, x$_3$, ..., x$_n$ from the vector space V. The linear manifold spanned by x$_1$, x$_2$, x$_3$, ..., x$_n$ is defined to be all elements of V of the form a$_1$x$_1$+a$_2$x$_2$+a$_3$x$_3$+...+a$_n$x$_n$ where a$_1$, a$_2$, a$_3$, ..., a$_n$ are all elements of the field F, and shall be denoted S(x$_1$, x$_2$, x$_3$, ..., x$_n$). This is obviously a linear subspace of the vector space V. Since every linear subspace of V contains x$_1$, x$_2$, x$_3$, ..., x$_n$ and their linear combinations, S(x$_1$, x$_2$, x$_3$, ..., x$_n$) is the smallest subspace containing x$_1$, x$_2$, x$_3$, ..., x$_n$.

## Theorem

If y$_1$, y$_2$, x$_y$, ..., y$_m$ are elements of S(x$_1$, x$_2$, x$_3$, ..., x$_n$), then S(y$_1$, y$_2$, y$_3$, ..., y$_m$) is contained within S(x$_1$, x$_2$, x$_3$, ..., x$_n$)

### Proof

All linear combinations of vectors which belong to a linear manifold also belong in the linear manifold (since a linear combination of linear combinations of vectors is also a linear combination of those vectors), and since any element of S(y$_1$, y$_2$, y$_3$, ..., y$_m$) is a linear combinations of vectors within the manifold, it too is within the set, thus proving that S(y$_1$, y$_2$, y$_3$, ..., y$_m$) is contained within S(y$_1$, y$_2$, y$_3$, ..., y$_m$).

## Theorem

If x is linearly dependent on other vectors upon other vectors x$_1$, x$_2$, x$_3$, ..., x$_n$, then it belongs to S(x, x$_1$, x$_2$, x$_3$, ..., x$_n$) also

### Proof

x, x$_1$, x$_2$, x$_3$, ..., x$_n$ all belong to S(x$_1$, x$_2$, x$_3$, ..., x$_n$), then S(x, x$_1$, x$_2$, x$_3$, ..., x$_n$) must be contained within S(x, x$_1$, x$_2$, x$_3$, ..., x$_n$). Therefore, if x is linearly dependent upon x$_1$, x$_2$, x$_3$, ..., x$_n$, then S(x, x$_1$, x$_2$, x$_3$, ..., x$_n$) is equal to S(x$_1$, x$_2$, x$_3$, ..., x$_n$).

## Theorem

The maximum number of linearly independent vectors of a set of vectors is equal to the dimension of the span of the set.

### Proof

Suppose that there are d linearly independent vectors among x$_1$, x$_2$, x$_3$, ..., x$_n$ with all other vectors being a linear combination of those d linearly independent vectors. This number d is the maximum number of linearly independent vectors among x$_1$, x$_2$, x$_3$, ..., x$_n$. Then any element of S(x$_1$, x$_2$, x$_3$, ..., x$_n$) must be a linear combination of those d linearly independent vectors, so they form a basis, and so d is the dimension of S(x$_1$, x$_2$, x$_3$, ..., x$_n$), which is equal to the maximum number of linearly independent vectors among x$_1$, x$_2$, x$_3$, ..., x$_n$.
# Pinyin/Nucleic acid

See also