Du befindest dich hier: FSI Informatik » Prüfungsfragen und Altklausuren » Prüfungen im Bachelor-Studium (1. - 5. Semester) » algoks » Forendiskussionen
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige ÜberarbeitungLetzte ÜberarbeitungBeide Seiten, nächste Überarbeitung | ||
pruefungen:bachelor:algoks:loesungws12 [20.07.2014 23:48] – elli | pruefungen:bachelor:algoks:loesungws12 [09.07.2015 11:10] – na02zijy | ||
---|---|---|---|
Zeile 82: | Zeile 82: | ||
**a)** | **a)** | ||
- | x = (-1, 2, -1, 2)^T | + | x = (1, 2, -1, 2)^T |
**b)** | **b)** | ||
Zeile 123: | Zeile 123: | ||
< | < | ||
- | |x_i+1 - x*| <= c * |x_i - x*| | + | |x_i+1 - x*| <= c * |x_i - x*| , wobei 0<c<1 |
</ | </ | ||
Zeile 200: | Zeile 200: | ||
float f_t = (1-s) * m_t0.f(t) + s * m_t1.f(t); | float f_t = (1-s) * m_t0.f(t) + s * m_t1.f(t); | ||
float f_s = (1-t) * m_s0.f(s) + t * m_s1.f(s); | float f_s = (1-t) * m_s0.f(s) + t * m_s1.f(s); | ||
- | float f_st = (1-t) * (1-s) * m_t0.f(0) + (1-s) * t * m_s1.f(0) + | + | float f_st = (1-t) * (1-s) * m_t0.f(0) + (1-s) * t * m_t0.f(1) + |
- | (1-t) * s * m_s0.f(0) + t * s * m_t1.f(1); | + | (1-t) * s * m_t1.f(0) + t * s * m_t1.f(1); |
return f_s + f_t - f_st; | return f_s + f_t - f_st; | ||
Zeile 213: | Zeile 213: | ||
float f_t = (-1) * m_t0.f(t) + m_t1.f(t); | float f_t = (-1) * m_t0.f(t) + m_t1.f(t); | ||
float f_s = (1-t) * m_s0.d(s) + t * m_s1.d(s); | float f_s = (1-t) * m_s0.d(s) + t * m_s1.d(s); | ||
- | float f_st = (1-t) * (-1) * m_t0.f(0) + (-1) * t * m_s1.f(0) + | + | float f_st = (1-t) * (-1) * m_t0.f(0) + (-1) * t * m_t0.f(1) + |
- | (1-t) * m_s0.f(0) + t * m_t1.f(1); | + | (1-t) * m_t1.f(0) + t * m_t1.f(1); |
return f_s + f_t - f_st; | return f_s + f_t - f_st; | ||
Zeile 239: | Zeile 239: | ||
<code cpp> | <code cpp> | ||
float CCSMatrix:: | float CCSMatrix:: | ||
- | for(int | + | for(int |
- | if(_rowIndices[rowP] == i) | + | if(_rowIndices[colP] == i) |
- | return _values[rowP]; | + | return _values[colP]; |
} | } | ||
Zeile 286: | Zeile 286: | ||
float sum = 0.0f; | float sum = 0.0f; | ||
- | for(int | + | for(int |
- | float v = other._values[rowP]; | + | float v = other._values[colP]; |
- | sum += v * getEntry(r, other._rowIndices[rowP]); | + | sum += v * getEntry(r, other._rowIndices[colP]); |
} | } | ||
result.setEntry(r, | result.setEntry(r, | ||
- | if(sum != 0) { | + | |
- | result._nonZeroElements++; | + | |
- | + | ||
} | } | ||
} | } | ||
} | } | ||
</ | </ |